public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: James Smart <jsmart2021@gmail.com>
To: linux-scsi@vger.kernel.org
Cc: ram.vegesna@broadcom.com, dan.carpenter@oracle.com,
	James Smart <jsmart2021@gmail.com>
Subject: [PATCH] elx: efct: fix is_originator return code type
Date: Fri, 18 Jun 2021 16:15:24 -0700	[thread overview]
Message-ID: <20210618231524.83179-1-jsmart2021@gmail.com> (raw)

efct_hw_iotype_is_originator is returning a negative (-EIO) status which
doesn't make sense for a u8 function type.

Reviewing the code, the function only needs to return true/false, thus a
bool status is most appropriate.

Change the function return type and patch up the one callee as the bool
inverses the if check.

Fixes: 4df84e846624 ("scsi: elx: efct: Driver initialization routines")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
---
 drivers/scsi/elx/efct/efct_hw.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/elx/efct/efct_hw.c b/drivers/scsi/elx/efct/efct_hw.c
index ce4736c41564..0d86c2b81f46 100644
--- a/drivers/scsi/elx/efct/efct_hw.c
+++ b/drivers/scsi/elx/efct/efct_hw.c
@@ -338,14 +338,14 @@ efct_hw_init_free_io(struct efct_hw_io *io)
 	io->wq = NULL;
 }
 
-static u8 efct_hw_iotype_is_originator(u16 io_type)
+static bool efct_hw_iotype_is_originator(u16 io_type)
 {
 	switch (io_type) {
 	case EFCT_HW_FC_CT:
 	case EFCT_HW_ELS_REQ:
-		return 0;
+		return true;
 	default:
-		return -EIO;
+		return false;
 	}
 }
 
@@ -408,7 +408,7 @@ efct_hw_wq_process_io(void *arg, u8 *cqe, int status)
 		 * If we're not an originator IO, and XB is set, then issue
 		 * abort for the IO from within the HW
 		 */
-		if ((!efct_hw_iotype_is_originator(io->type)) &&
+		if (efct_hw_iotype_is_originator(io->type) &&
 		    wcqe->flags & SLI4_WCQE_XB) {
 			int rc;
 
-- 
2.26.2


             reply	other threads:[~2021-06-18 23:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-18 23:15 James Smart [this message]
2021-06-19  2:39 ` [PATCH] elx: efct: fix is_originator return code type Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210618231524.83179-1-jsmart2021@gmail.com \
    --to=jsmart2021@gmail.com \
    --cc=dan.carpenter@oracle.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=ram.vegesna@broadcom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox