mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: qla2xxx-upstream@qlogic.com,
	"James E.J. Bottomley" <jejb@linux.vnet.ibm.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Himanshu Madhani <himanshu.madhani@cavium.com>,
	Darren Trapp <darren.trapp@cavium.com>,
	Giridhar Malavali <giridhar.malavali@cavium.com>,
	Duane Grigsby <duane.grigsby@cavium.com>,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 1/2] scsi: qla2xxx: remove incorrect byte swap
Date: Fri, 30 Jun 2017 18:10:39 +0200	[thread overview]
Message-ID: <20170630161056.30630-1-arnd@arndb.de> (raw)

cont_pkt->entry_type is an 8-bit field, so doing a 32-bit byteswap
on it will store incorrect data:

drivers/scsi/qla2xxx/qla_nvme.c: In function 'qla2x00_start_nvme_mq':
include/uapi/linux/byteorder/big_endian.h:32:26: error: large integer implicitly truncated to unsigned type [-Werror=overflow]
drivers/scsi/qla2xxx/qla_nvme.c:444:27: note: in expansion of macro 'cpu_to_le32'
    cont_pkt->entry_type = cpu_to_le32(CONTINUE_A64_TYPE);

This removes the erroneous cpu_to_le32().

Fixes: e84067d74301 ("scsi: qla2xxx: Add FC-NVMe F/W initialization and transport registration")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/scsi/qla2xxx/qla_nvme.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/qla2xxx/qla_nvme.c b/drivers/scsi/qla2xxx/qla_nvme.c
index 1da8fa8f641d..14e25e32e622 100644
--- a/drivers/scsi/qla2xxx/qla_nvme.c
+++ b/drivers/scsi/qla2xxx/qla_nvme.c
@@ -441,7 +441,7 @@ static int qla2x00_start_nvme_mq(srb_t *sp)
 				req->ring_ptr++;
 			}
 			cont_pkt = (cont_a64_entry_t *)req->ring_ptr;
-			cont_pkt->entry_type = cpu_to_le32(CONTINUE_A64_TYPE);
+			cont_pkt->entry_type = CONTINUE_A64_TYPE;
 
 			cur_dsd = (uint32_t *)cont_pkt->dseg_0_address;
 			avail_dsds = 5;
-- 
2.9.0

             reply	other threads:[~2017-06-30 16:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-30 16:10 Arnd Bergmann [this message]
2017-06-30 16:10 ` [PATCH 2/2] scsi: qla2xxx: avoid unused-function warning Arnd Bergmann
2017-06-30 23:54   ` Madhani, Himanshu
2017-07-01 21:15   ` Martin K. Petersen
2017-06-30 16:41 ` [PATCH 1/2] scsi: qla2xxx: remove incorrect byte swap James Bottomley
2017-06-30 17:00   ` Madhani, Himanshu

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=20170630161056.30630-1-arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=darren.trapp@cavium.com \
    --cc=duane.grigsby@cavium.com \
    --cc=giridhar.malavali@cavium.com \
    --cc=himanshu.madhani@cavium.com \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=qla2xxx-upstream@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®