All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Nicholas Bellinger <nab@linux-iscsi.org>
Cc: qla2xxx-upstream@qlogic.com,
	"James E.J. Bottomley" <JBottomley@odin.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Alexei Potashnik <alexei@purestorage.com>,
	Quinn Tran <quinn.tran@qlogic.com>,
	Himanshu Madhani <himanshu.madhani@qlogic.com>,
	Hannes Reinecke <hare@suse.com>
Subject: [PATCH] scsi: qla2xxxx: avoid type mismatch in comparison
Date: Wed, 20 Jan 2016 11:47:14 +0100	[thread overview]
Message-ID: <1603472.f34vvTrhuN@wuerfel> (raw)

A recent bug fix added code that does

        bool logged_out = (status & 0xFFFF);
        if (logged_out == CTIO_PORT_LOGGED_OUT)
		...

This looks wrong because we are comparing a boolean with an
integer constant, ang gcc warns about it accordingly:

drivers/scsi/qla2xxx/qla_target.c: In function 'qlt_do_ctio_completion':
drivers/scsi/qla2xxx/qla_target.c:3587:20: warning: comparison of constant '41' with boolean expression is always false [-Wbool-compare]
        (logged_out == CTIO_PORT_LOGGED_OUT) ?

The correct fix is presumably to make that variable an 'int'.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 71cdc0796465 ("qla2xxx: Delete session if initiator is gone from FW")
---
The patch introducing this is currenly in linux-next through the target-updates/for-next
branch.

diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c
index c7ab9e69c881..8075a4cdb45c 100644
--- a/drivers/scsi/qla2xxx/qla_target.c
+++ b/drivers/scsi/qla2xxx/qla_target.c
@@ -3580,7 +3580,7 @@ static void qlt_do_ctio_completion(struct scsi_qla_host *vha, uint32_t handle,
 		case CTIO_PORT_LOGGED_OUT:
 		case CTIO_PORT_UNAVAILABLE:
 		{
-			bool logged_out = (status & 0xFFFF);
+			int logged_out = (status & 0xFFFF);
 			ql_dbg(ql_dbg_tgt_mgt, vha, 0xf059,
 			    "qla_target(%d): CTIO with %s status %x "
 			    "received (state %x, se_cmd %p)\n", vha->vp_idx,


WARNING: multiple messages have this Message-ID (diff)
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] scsi: qla2xxxx: avoid type mismatch in comparison
Date: Wed, 20 Jan 2016 11:47:14 +0100	[thread overview]
Message-ID: <1603472.f34vvTrhuN@wuerfel> (raw)

A recent bug fix added code that does

        bool logged_out = (status & 0xFFFF);
        if (logged_out == CTIO_PORT_LOGGED_OUT)
		...

This looks wrong because we are comparing a boolean with an
integer constant, ang gcc warns about it accordingly:

drivers/scsi/qla2xxx/qla_target.c: In function 'qlt_do_ctio_completion':
drivers/scsi/qla2xxx/qla_target.c:3587:20: warning: comparison of constant '41' with boolean expression is always false [-Wbool-compare]
        (logged_out == CTIO_PORT_LOGGED_OUT) ?

The correct fix is presumably to make that variable an 'int'.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 71cdc0796465 ("qla2xxx: Delete session if initiator is gone from FW")
---
The patch introducing this is currenly in linux-next through the target-updates/for-next
branch.

diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c
index c7ab9e69c881..8075a4cdb45c 100644
--- a/drivers/scsi/qla2xxx/qla_target.c
+++ b/drivers/scsi/qla2xxx/qla_target.c
@@ -3580,7 +3580,7 @@ static void qlt_do_ctio_completion(struct scsi_qla_host *vha, uint32_t handle,
 		case CTIO_PORT_LOGGED_OUT:
 		case CTIO_PORT_UNAVAILABLE:
 		{
-			bool logged_out = (status & 0xFFFF);
+			int logged_out = (status & 0xFFFF);
 			ql_dbg(ql_dbg_tgt_mgt, vha, 0xf059,
 			    "qla_target(%d): CTIO with %s status %x "
 			    "received (state %x, se_cmd %p)\n", vha->vp_idx,

             reply	other threads:[~2016-01-20 10:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-20 10:47 Arnd Bergmann [this message]
2016-01-20 10:47 ` [PATCH] scsi: qla2xxxx: avoid type mismatch in comparison Arnd Bergmann
2016-01-20 11:04 ` Nicholas A. Bellinger
2016-01-20 11:04   ` Nicholas A. Bellinger
2016-01-20 16:10 ` Bart Van Assche
2016-01-20 16:10   ` Bart Van Assche
2016-01-20 16:10   ` Bart Van Assche

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=1603472.f34vvTrhuN@wuerfel \
    --to=arnd@arndb.de \
    --cc=JBottomley@odin.com \
    --cc=alexei@purestorage.com \
    --cc=hare@suse.com \
    --cc=himanshu.madhani@qlogic.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=nab@linux-iscsi.org \
    --cc=qla2xxx-upstream@qlogic.com \
    --cc=quinn.tran@qlogic.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.