]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
scsi: qla2xxx: edif: Fix clang warning
authorQuinn Tran <qutran@marvell.com>
Thu, 22 Dec 2022 04:39:31 +0000 (20:39 -0800)
committerAndrea Righi <andrea.righi@canonical.com>
Tue, 14 Mar 2023 15:46:39 +0000 (16:46 +0100)
BugLink: https://bugs.launchpad.net/bugs/2011425
[ Upstream commit 2f5fab1b6c3a8efc93ba52c28539c45a8d0142ad ]

clang warning:

  drivers/scsi/qla2xxx/qla_edif_bsg.h:93:12: warning: field remote_pid
  within 'struct app_pinfo_req' is less aligned than 'port_id_t' and is
  usually due to 'struct app_pinfo_req' being packed, which can lead to
  unaligned accesses [-Wunaligned-access]
  port_id_t remote_pid;
        ^
  2 warnings generated.

Remove u32 field in remote_pid to silence warning.

Reported-by: kernel test robot <lkp@intel.com>
Fixes: 7ebb336e45ef ("scsi: qla2xxx: edif: Add start + stop bsgs")
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
drivers/scsi/qla2xxx/qla_edif.c
drivers/scsi/qla2xxx/qla_edif_bsg.h

index 53186a14596294984797f75a389e1a1821f51c75..38d5bda1f27489fbc38d606a1d5e22fd7305942b 100644 (file)
@@ -925,7 +925,9 @@ qla_edif_app_getfcinfo(scsi_qla_host_t *vha, struct bsg_job *bsg_job)
                        if (!(fcport->flags & FCF_FCSP_DEVICE))
                                continue;
 
-                       tdid = app_req.remote_pid;
+                       tdid.b.domain = app_req.remote_pid.domain;
+                       tdid.b.area = app_req.remote_pid.area;
+                       tdid.b.al_pa = app_req.remote_pid.al_pa;
 
                        ql_dbg(ql_dbg_edif, vha, 0x2058,
                            "APP request entry - portid=%06x.\n", tdid.b24);
index 0931f4e4e127aebb23978c8eed1b11a68ab8d9d9..514c265ba86e2fba3b7957a3f17b85d27ef42150 100644 (file)
@@ -89,7 +89,20 @@ struct app_plogi_reply {
 struct app_pinfo_req {
        struct app_id app_info;
        uint8_t  num_ports;
-       port_id_t remote_pid;
+       struct {
+#ifdef __BIG_ENDIAN
+               uint8_t domain;
+               uint8_t area;
+               uint8_t al_pa;
+#elif defined(__LITTLE_ENDIAN)
+               uint8_t al_pa;
+               uint8_t area;
+               uint8_t domain;
+#else
+#error "__BIG_ENDIAN or __LITTLE_ENDIAN must be defined!"
+#endif
+               uint8_t rsvd_1;
+       } remote_pid;
        uint8_t         version;
        uint8_t         pad[VND_CMD_PAD_SIZE];
        uint8_t         reserved[VND_CMD_APP_RESERVED_SIZE];