All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] qla2xxx: Fix NVMe entry_type for iocb packet on BE system
@ 2017-07-01  2:32 Himanshu Madhani
  2017-07-01 21:22 ` Martin K. Petersen
  0 siblings, 1 reply; 2+ messages in thread
From: Himanshu Madhani @ 2017-07-01  2:32 UTC (permalink / raw)
  To: James.Bottomley, martin.petersen; +Cc: himanshu.madhani, linux-scsi

This patch fixes incorrect assignment for entry_type field for Continuation
Type iocb packet on BE system. This was caught by -Woverflow warning on BE
system compilation.

For Continuation Type iocb driver needs to write complete 32 bit value to
initialize other field members in stucture to 0.

Following warning is seen on BE system compile: 

drivers/scsi/qla2xxx/qla_nvme.c: In function 'qla2x00_start_nvme_mq':
include/uapi/linux/byteorder/big_endian.h:32:26: warning: large integer
implicitly truncated to unsigned type [-Woverflow]
 #define __cpu_to_le32(x) ((__force __le32)__swab32((x)))

Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>

---
Changes from v1 --> v2

o Modified commit message and description to clarify issue 
  in qla2xxx NVMe initiator code on BE system.

---
 drivers/scsi/qla2xxx/qla_nvme.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/qla2xxx/qla_nvme.c b/drivers/scsi/qla2xxx/qla_nvme.c
index 1da8fa8f641d..367cf8613b15 100644
--- a/drivers/scsi/qla2xxx/qla_nvme.c
+++ b/drivers/scsi/qla2xxx/qla_nvme.c
@@ -441,7 +441,8 @@ 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);
+			*((uint32_t *)(&cont_pkt->entry_type)) =
+			    cpu_to_le32(CONTINUE_A64_TYPE);
 
 			cur_dsd = (uint32_t *)cont_pkt->dseg_0_address;
 			avail_dsds = 5;
-- 
2.11.0

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

* Re: [PATCH v2] qla2xxx: Fix NVMe entry_type for iocb packet on BE system
  2017-07-01  2:32 [PATCH v2] qla2xxx: Fix NVMe entry_type for iocb packet on BE system Himanshu Madhani
@ 2017-07-01 21:22 ` Martin K. Petersen
  0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2017-07-01 21:22 UTC (permalink / raw)
  To: Himanshu Madhani; +Cc: James.Bottomley, martin.petersen, linux-scsi


Himanshu,

> This patch fixes incorrect assignment for entry_type field for Continuation
> Type iocb packet on BE system. This was caught by -Woverflow warning on BE
> system compilation.
>
> For Continuation Type iocb driver needs to write complete 32 bit value to
> initialize other field members in stucture to 0.
>
> Following warning is seen on BE system compile: 
>
> drivers/scsi/qla2xxx/qla_nvme.c: In function 'qla2x00_start_nvme_mq':
> include/uapi/linux/byteorder/big_endian.h:32:26: warning: large integer
> implicitly truncated to unsigned type [-Woverflow]
>  #define __cpu_to_le32(x) ((__force __le32)__swab32((x)))

Applied to 4.13/scsi-queue.

-- 
Martin K. Petersen	Oracle Linux Engineering

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

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-01  2:32 [PATCH v2] qla2xxx: Fix NVMe entry_type for iocb packet on BE system Himanshu Madhani
2017-07-01 21:22 ` Martin K. Petersen

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.