Commit a7fc071a authored by Dick Kennedy's avatar Dick Kennedy Committed by Martin K. Petersen

scsi: lpfc: Fix noderef and address space warnings

Running make C=1 M=drivers/scsi/lpfc triggers sparse warnings

Correct the code generating the following errors:

 - Incompatible address space assignment without proper conversion.

 - Deference of usespace and per-cpu pointers.

Link: https://lore.kernel.org/r/20200501214310.91713-8-jsmart2021@gmail.comReviewed-by: default avatarHannes Reinecke <hare@suse.de>
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 88acb4d9
...@@ -2436,7 +2436,8 @@ lpfc_debugfs_dif_err_write(struct file *file, const char __user *buf, ...@@ -2436,7 +2436,8 @@ lpfc_debugfs_dif_err_write(struct file *file, const char __user *buf,
return 0; return 0;
if (dent == phba->debug_InjErrLBA) { if (dent == phba->debug_InjErrLBA) {
if ((buf[0] == 'o') && (buf[1] == 'f') && (buf[2] == 'f')) if ((dstbuf[0] == 'o') && (dstbuf[1] == 'f') &&
(dstbuf[2] == 'f'))
tmp = (uint64_t)(-1); tmp = (uint64_t)(-1);
} }
......
...@@ -1378,7 +1378,8 @@ lpfc_config_port(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) ...@@ -1378,7 +1378,8 @@ lpfc_config_port(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
*/ */
if (phba->cfg_hostmem_hgp && phba->sli_rev != 3) { if (phba->cfg_hostmem_hgp && phba->sli_rev != 3) {
phba->host_gp = &phba->mbox->us.s2.host[0]; phba->host_gp = (struct lpfc_hgp __iomem *)
&phba->mbox->us.s2.host[0];
phba->hbq_put = NULL; phba->hbq_put = NULL;
offset = (uint8_t *)&phba->mbox->us.s2.host - offset = (uint8_t *)&phba->mbox->us.s2.host -
(uint8_t *)phba->slim2p.virt; (uint8_t *)phba->slim2p.virt;
......
...@@ -14272,7 +14272,6 @@ lpfc_sli4_hba_intr_handler(int irq, void *dev_id) ...@@ -14272,7 +14272,6 @@ lpfc_sli4_hba_intr_handler(int irq, void *dev_id)
int ecount = 0; int ecount = 0;
int hba_eqidx; int hba_eqidx;
struct lpfc_eq_intr_info *eqi; struct lpfc_eq_intr_info *eqi;
uint32_t icnt;
/* Get the driver's phba structure from the dev_id */ /* Get the driver's phba structure from the dev_id */
hba_eq_hdl = (struct lpfc_hba_eq_hdl *)dev_id; hba_eq_hdl = (struct lpfc_hba_eq_hdl *)dev_id;
...@@ -14300,11 +14299,12 @@ lpfc_sli4_hba_intr_handler(int irq, void *dev_id) ...@@ -14300,11 +14299,12 @@ lpfc_sli4_hba_intr_handler(int irq, void *dev_id)
return IRQ_NONE; return IRQ_NONE;
} }
eqi = phba->sli4_hba.eq_info; eqi = this_cpu_ptr(phba->sli4_hba.eq_info);
icnt = this_cpu_inc_return(eqi->icnt); eqi->icnt++;
fpeq->last_cpu = raw_smp_processor_id(); fpeq->last_cpu = raw_smp_processor_id();
if (icnt > LPFC_EQD_ISR_TRIGGER && if (eqi->icnt > LPFC_EQD_ISR_TRIGGER &&
fpeq->q_flag & HBA_EQ_DELAY_CHK && fpeq->q_flag & HBA_EQ_DELAY_CHK &&
phba->cfg_auto_imax && phba->cfg_auto_imax &&
fpeq->q_mode != LPFC_MAX_AUTO_EQ_DELAY && fpeq->q_mode != LPFC_MAX_AUTO_EQ_DELAY &&
......
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