linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] scsi: qla2xxx: remove incorrect byte swap
@ 2017-06-30 16:10 Arnd Bergmann
  2017-06-30 16:10 ` [PATCH 2/2] scsi: qla2xxx: avoid unused-function warning Arnd Bergmann
  2017-06-30 16:41 ` [PATCH 1/2] scsi: qla2xxx: remove incorrect byte swap James Bottomley
  0 siblings, 2 replies; 6+ messages in thread
From: Arnd Bergmann @ 2017-06-30 16:10 UTC (permalink / raw)
  To: qla2xxx-upstream, James E.J. Bottomley, Martin K. Petersen
  Cc: Arnd Bergmann, Himanshu Madhani, Darren Trapp, Giridhar Malavali,
	Duane Grigsby, linux-scsi, linux-kernel

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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-07-01 21:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-30 16:10 [PATCH 1/2] scsi: qla2xxx: remove incorrect byte swap Arnd Bergmann
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).