Commit 73825fd7 authored by Quinn Tran's avatar Quinn Tran Committed by Martin K. Petersen

scsi: qla2xxx: edif: Fix clang warning

Silence compile warning due to unaligned memory access.

qla_edif.c:713:45: warning: taking address of packed member 'u' of class or
   structure 'auth_complete_cmd' may result in an unaligned pointer value
   [-Waddress-of-packed-member]
    fcport = qla2x00_find_fcport_by_pid(vha, &appplogiok.u.d_id);

Link: https://lore.kernel.org/r/20220110050218.3958-13-njavali@marvell.com
Cc: stable@vger.kernel.org
Reported-by: default avatarkernel test robot <lkp@intel.com>
Reviewed-by: default avatarHimanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: default avatarQuinn Tran <qutran@marvell.com>
Signed-off-by: default avatarNilesh Javali <njavali@marvell.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 14cb838d
...@@ -668,6 +668,11 @@ qla_edif_app_authok(scsi_qla_host_t *vha, struct bsg_job *bsg_job) ...@@ -668,6 +668,11 @@ qla_edif_app_authok(scsi_qla_host_t *vha, struct bsg_job *bsg_job)
bsg_job->request_payload.sg_cnt, &appplogiok, bsg_job->request_payload.sg_cnt, &appplogiok,
sizeof(struct auth_complete_cmd)); sizeof(struct auth_complete_cmd));
/* silent unaligned access warning */
portid.b.domain = appplogiok.u.d_id.b.domain;
portid.b.area = appplogiok.u.d_id.b.area;
portid.b.al_pa = appplogiok.u.d_id.b.al_pa;
switch (appplogiok.type) { switch (appplogiok.type) {
case PL_TYPE_WWPN: case PL_TYPE_WWPN:
fcport = qla2x00_find_fcport_by_wwpn(vha, fcport = qla2x00_find_fcport_by_wwpn(vha,
...@@ -678,7 +683,7 @@ qla_edif_app_authok(scsi_qla_host_t *vha, struct bsg_job *bsg_job) ...@@ -678,7 +683,7 @@ qla_edif_app_authok(scsi_qla_host_t *vha, struct bsg_job *bsg_job)
__func__, appplogiok.u.wwpn); __func__, appplogiok.u.wwpn);
break; break;
case PL_TYPE_DID: case PL_TYPE_DID:
fcport = qla2x00_find_fcport_by_pid(vha, &appplogiok.u.d_id); fcport = qla2x00_find_fcport_by_pid(vha, &portid);
if (!fcport) if (!fcport)
ql_dbg(ql_dbg_edif, vha, 0x911d, ql_dbg(ql_dbg_edif, vha, 0x911d,
"%s d_id lookup failed: %x\n", __func__, "%s d_id lookup failed: %x\n", __func__,
...@@ -777,6 +782,11 @@ qla_edif_app_authfail(scsi_qla_host_t *vha, struct bsg_job *bsg_job) ...@@ -777,6 +782,11 @@ qla_edif_app_authfail(scsi_qla_host_t *vha, struct bsg_job *bsg_job)
bsg_job->request_payload.sg_cnt, &appplogifail, bsg_job->request_payload.sg_cnt, &appplogifail,
sizeof(struct auth_complete_cmd)); sizeof(struct auth_complete_cmd));
/* silent unaligned access warning */
portid.b.domain = appplogifail.u.d_id.b.domain;
portid.b.area = appplogifail.u.d_id.b.area;
portid.b.al_pa = appplogifail.u.d_id.b.al_pa;
/* /*
* TODO: edif: app has failed this plogi. Inform driver to * TODO: edif: app has failed this plogi. Inform driver to
* take any action (if any). * take any action (if any).
...@@ -788,7 +798,7 @@ qla_edif_app_authfail(scsi_qla_host_t *vha, struct bsg_job *bsg_job) ...@@ -788,7 +798,7 @@ qla_edif_app_authfail(scsi_qla_host_t *vha, struct bsg_job *bsg_job)
SET_DID_STATUS(bsg_reply->result, DID_OK); SET_DID_STATUS(bsg_reply->result, DID_OK);
break; break;
case PL_TYPE_DID: case PL_TYPE_DID:
fcport = qla2x00_find_fcport_by_pid(vha, &appplogifail.u.d_id); fcport = qla2x00_find_fcport_by_pid(vha, &portid);
if (!fcport) if (!fcport)
ql_dbg(ql_dbg_edif, vha, 0x911d, ql_dbg(ql_dbg_edif, vha, 0x911d,
"%s d_id lookup failed: %x\n", __func__, "%s d_id lookup failed: %x\n", __func__,
...@@ -1253,6 +1263,7 @@ qla24xx_sadb_update(struct bsg_job *bsg_job) ...@@ -1253,6 +1263,7 @@ qla24xx_sadb_update(struct bsg_job *bsg_job)
int result = 0; int result = 0;
struct qla_sa_update_frame sa_frame; struct qla_sa_update_frame sa_frame;
struct srb_iocb *iocb_cmd; struct srb_iocb *iocb_cmd;
port_id_t portid;
ql_dbg(ql_dbg_edif + ql_dbg_verbose, vha, 0x911d, ql_dbg(ql_dbg_edif + ql_dbg_verbose, vha, 0x911d,
"%s entered, vha: 0x%p\n", __func__, vha); "%s entered, vha: 0x%p\n", __func__, vha);
...@@ -1276,7 +1287,12 @@ qla24xx_sadb_update(struct bsg_job *bsg_job) ...@@ -1276,7 +1287,12 @@ qla24xx_sadb_update(struct bsg_job *bsg_job)
goto done; goto done;
} }
fcport = qla2x00_find_fcport_by_pid(vha, &sa_frame.port_id); /* silent unaligned access warning */
portid.b.domain = sa_frame.port_id.b.domain;
portid.b.area = sa_frame.port_id.b.area;
portid.b.al_pa = sa_frame.port_id.b.al_pa;
fcport = qla2x00_find_fcport_by_pid(vha, &portid);
if (fcport) { if (fcport) {
found = 1; found = 1;
if (sa_frame.flags == QLA_SA_UPDATE_FLAGS_TX_KEY) if (sa_frame.flags == QLA_SA_UPDATE_FLAGS_TX_KEY)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment