Commit d9f492a1 authored by James Smart's avatar James Smart Committed by Martin K. Petersen

scsi: lpfc: Fix coverity warnings

Running on Coverity produced the following errors:

 - coding style (indentation)

 - memset size mismatch errors
   note: comment cases where it is purposely a mismatch

Fix the errors.
Signed-off-by: default avatarDick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: default avatarJames Smart <jsmart2021@gmail.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent db197bc4
...@@ -5667,16 +5667,16 @@ lpfc_rdp_res_attach_port_names(struct fc_rdp_port_name_desc *desc, ...@@ -5667,16 +5667,16 @@ lpfc_rdp_res_attach_port_names(struct fc_rdp_port_name_desc *desc,
desc->tag = cpu_to_be32(RDP_PORT_NAMES_DESC_TAG); desc->tag = cpu_to_be32(RDP_PORT_NAMES_DESC_TAG);
if (vport->fc_flag & FC_FABRIC) { if (vport->fc_flag & FC_FABRIC) {
memcpy(desc->port_names.wwnn, &vport->fabric_nodename, memcpy(desc->port_names.wwnn, &vport->fabric_nodename,
sizeof(desc->port_names.wwnn)); sizeof(desc->port_names.wwnn));
memcpy(desc->port_names.wwpn, &vport->fabric_portname, memcpy(desc->port_names.wwpn, &vport->fabric_portname,
sizeof(desc->port_names.wwpn)); sizeof(desc->port_names.wwpn));
} else { /* Point to Point */ } else { /* Point to Point */
memcpy(desc->port_names.wwnn, &ndlp->nlp_nodename, memcpy(desc->port_names.wwnn, &ndlp->nlp_nodename,
sizeof(desc->port_names.wwnn)); sizeof(desc->port_names.wwnn));
memcpy(desc->port_names.wwnn, &ndlp->nlp_portname, memcpy(desc->port_names.wwpn, &ndlp->nlp_portname,
sizeof(desc->port_names.wwpn)); sizeof(desc->port_names.wwpn));
} }
desc->length = cpu_to_be32(sizeof(desc->port_names)); desc->length = cpu_to_be32(sizeof(desc->port_names));
......
...@@ -436,6 +436,7 @@ lpfc_nvme_gen_req(struct lpfc_vport *vport, struct lpfc_dmabuf *bmp, ...@@ -436,6 +436,7 @@ lpfc_nvme_gen_req(struct lpfc_vport *vport, struct lpfc_dmabuf *bmp,
return 1; return 1;
wqe = &genwqe->wqe; wqe = &genwqe->wqe;
/* Initialize only 64 bytes */
memset(wqe, 0, sizeof(union lpfc_wqe)); memset(wqe, 0, sizeof(union lpfc_wqe));
genwqe->context3 = (uint8_t *)bmp; genwqe->context3 = (uint8_t *)bmp;
...@@ -1855,7 +1856,7 @@ lpfc_nvme_fcp_abort(struct nvme_fc_local_port *pnvme_lport, ...@@ -1855,7 +1856,7 @@ lpfc_nvme_fcp_abort(struct nvme_fc_local_port *pnvme_lport,
/* WQEs are reused. Clear stale data and set key fields to /* WQEs are reused. Clear stale data and set key fields to
* zero like ia, iaab, iaar, xri_tag, and ctxt_tag. * zero like ia, iaab, iaar, xri_tag, and ctxt_tag.
*/ */
memset(abts_wqe, 0, sizeof(union lpfc_wqe)); memset(abts_wqe, 0, sizeof(*abts_wqe));
bf_set(abort_cmd_criteria, &abts_wqe->abort_cmd, T_XRI_TAG); bf_set(abort_cmd_criteria, &abts_wqe->abort_cmd, T_XRI_TAG);
/* word 7 */ /* word 7 */
...@@ -1982,7 +1983,7 @@ lpfc_get_nvme_buf(struct lpfc_hba *phba, struct lpfc_nodelist *ndlp, ...@@ -1982,7 +1983,7 @@ lpfc_get_nvme_buf(struct lpfc_hba *phba, struct lpfc_nodelist *ndlp,
sgl->word2 = cpu_to_le32(sgl->word2); sgl->word2 = cpu_to_le32(sgl->word2);
/* Fill in word 3 / sgl_len during cmd submission */ /* Fill in word 3 / sgl_len during cmd submission */
/* Initialize WQE */ /* Initialize 64 bytes only */
memset(wqe, 0, sizeof(union lpfc_wqe)); memset(wqe, 0, sizeof(union lpfc_wqe));
if (lpfc_ndlp_check_qdepth(phba, ndlp)) { if (lpfc_ndlp_check_qdepth(phba, ndlp)) {
......
...@@ -3330,7 +3330,7 @@ lpfc_nvmet_sol_fcp_issue_abort(struct lpfc_hba *phba, ...@@ -3330,7 +3330,7 @@ lpfc_nvmet_sol_fcp_issue_abort(struct lpfc_hba *phba,
/* WQEs are reused. Clear stale data and set key fields to /* WQEs are reused. Clear stale data and set key fields to
* zero like ia, iaab, iaar, xri_tag, and ctxt_tag. * zero like ia, iaab, iaar, xri_tag, and ctxt_tag.
*/ */
memset(abts_wqe, 0, sizeof(union lpfc_wqe)); memset(abts_wqe, 0, sizeof(*abts_wqe));
/* word 3 */ /* word 3 */
bf_set(abort_cmd_criteria, &abts_wqe->abort_cmd, T_XRI_TAG); bf_set(abort_cmd_criteria, &abts_wqe->abort_cmd, T_XRI_TAG);
......
...@@ -9815,7 +9815,7 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq, ...@@ -9815,7 +9815,7 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq,
* we re-construct this WQE here based on information in * we re-construct this WQE here based on information in
* iocbq from scratch. * iocbq from scratch.
*/ */
memset(wqe, 0, sizeof(union lpfc_wqe)); memset(wqe, 0, sizeof(*wqe));
/* OX_ID is invariable to who sent ABTS to CT exchange */ /* OX_ID is invariable to who sent ABTS to CT exchange */
bf_set(xmit_bls_rsp64_oxid, &wqe->xmit_bls_rsp, bf_set(xmit_bls_rsp64_oxid, &wqe->xmit_bls_rsp,
bf_get(lpfc_abts_oxid, &iocbq->iocb.un.bls_rsp)); bf_get(lpfc_abts_oxid, &iocbq->iocb.un.bls_rsp));
......
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