Skip to content

Commit

Permalink
cxl/pci: Use CXL_MBOX_SUCCESS to check against mbox_cmd return code
Browse files Browse the repository at this point in the history
Also mention the need for the caller to check against any
errors from the hardware in return_code.

Signed-off-by: Davidlohr Bueso <dave@stgolabs.net>
Reviewed by: Adam Manzanares <a.manzanares@samsung.com>
Link: https://lore.kernel.org/r/20220404021216.66841-3-dave@stgolabs.net
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
  • Loading branch information
Davidlohr Bueso authored and djbw committed Apr 12, 2022
1 parent ee92c7e commit cbe83a2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/cxl/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,9 @@ static int __cxl_pci_mbox_send_cmd(struct cxl_dev_state *cxlds,
mbox_cmd->return_code =
FIELD_GET(CXLDEV_MBOX_STATUS_RET_CODE_MASK, status_reg);

if (mbox_cmd->return_code != 0) {
if (mbox_cmd->return_code != CXL_MBOX_SUCCESS) {
dev_dbg(dev, "Mailbox operation had an error\n");
return 0;
return 0; /* completed but caller must check return_code */
}

/* #7 */
Expand Down

0 comments on commit cbe83a2

Please sign in to comment.