]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
scsi: lpfc: Fix CPU to/from endian warnings introduced by ELS processing
authorJames Smart <jsmart2021@gmail.com>
Mon, 30 Aug 2021 23:12:43 +0000 (16:12 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 14 Sep 2021 02:15:40 +0000 (22:15 -0400)
commit59936430e6a6acb0ef943e9306506b2e9c2e45a8
tree7340fcbc2b7cfabafed3f46ad9d03d4e311eeaaf
parent96fafe7c6523886308605d30ec92c7936abe7c2c
scsi: lpfc: Fix CPU to/from endian warnings introduced by ELS processing

The kernel test robot reported the following sparse warning:
".../lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16"

For the error being flagged, using be32_to_cpu() on a be16 data type, it
was simple enough. But a review of other elements and warnings were also
evaluated.

This patch corrected several items in the original patch:

 - Using be32_to_cpu() on a be16 data type

 - cpu_to_le32() used on a std uint32_t (CPU) data type.

   Note: This is a byte array, but stored in LE layout by hardware at
   32-bit boundaries. So it possibly needed conversion.

 - Using cpu_to_le32() on a std uint16_t and assigned to a char typeA

 - Using le32_to_cpu() on a le16 type

 - Missing cpu_to_le16() on an assignment

Link: https://lore.kernel.org/r/20210830231243.6227-1-jsmart2021@gmail.com
Fixes: 9064aeb2df8e ("scsi: lpfc: Add EDC ELS support")
Reported-by: kernel test robot <lkp@intel.com>
Co-developed-by: Justin Tee <justin.tee@broadcom.com>
Signed-off-by: Justin Tee <justin.tee@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_els.c
drivers/scsi/lpfc/lpfc_hw4.h
drivers/scsi/lpfc/lpfc_init.c
drivers/scsi/lpfc/lpfc_sli.c