提交 a99c8074 编写于 作者: J James Smart 提交者: Martin K. Petersen

scsi: lpfc: Fix compiler warning on frame size

The following error is see from the compiler:

  drivers/scsi/lpfc/lpfc_init.c: In function
    ‘lpfc_cpuhp_get_eq’: drivers/scsi/lpfc/lpfc_init.c:12660:1:
      error: the frame size of 1032 bytes is larger than 1024 bytes
         [-Werror=frame-larger-than=]

The issue is due to allocating a cpumask on the stack.

Fix by converting to a dynamical allocation of the cpu mask.

Link: https://lore.kernel.org/r/20200128002312.16346-7-jsmart2021@gmail.comSigned-off-by: NDick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: NJames Smart <jsmart2021@gmail.com>
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
上级 821bc882
......@@ -11106,15 +11106,19 @@ lpfc_cpu_affinity_check(struct lpfc_hba *phba, int vectors)
* @cpu: cpu going offline
* @eqlist:
*/
static void
static int
lpfc_cpuhp_get_eq(struct lpfc_hba *phba, unsigned int cpu,
struct list_head *eqlist)
{
const struct cpumask *maskp;
struct lpfc_queue *eq;
cpumask_t tmp;
struct cpumask *tmp;
u16 idx;
tmp = kzalloc(cpumask_size(), GFP_KERNEL);
if (!tmp)
return -ENOMEM;
for (idx = 0; idx < phba->cfg_irq_chann; idx++) {
maskp = pci_irq_get_affinity(phba->pcidev, idx);
if (!maskp)
......@@ -11124,7 +11128,7 @@ lpfc_cpuhp_get_eq(struct lpfc_hba *phba, unsigned int cpu,
* then we don't need to poll the eq attached
* to it.
*/
if (!cpumask_and(&tmp, maskp, cpumask_of(cpu)))
if (!cpumask_and(tmp, maskp, cpumask_of(cpu)))
continue;
/* get the cpus that are online and are affini-
* tized to this irq vector. If the count is
......@@ -11132,8 +11136,8 @@ lpfc_cpuhp_get_eq(struct lpfc_hba *phba, unsigned int cpu,
* down this vector. Since this cpu has not
* gone offline yet, we need >1.
*/
cpumask_and(&tmp, maskp, cpu_online_mask);
if (cpumask_weight(&tmp) > 1)
cpumask_and(tmp, maskp, cpu_online_mask);
if (cpumask_weight(tmp) > 1)
continue;
/* Now that we have an irq to shutdown, get the eq
......@@ -11144,6 +11148,8 @@ lpfc_cpuhp_get_eq(struct lpfc_hba *phba, unsigned int cpu,
eq = phba->sli4_hba.hba_eq_hdl[idx].eq;
list_add(&eq->_poll_list, eqlist);
}
kfree(tmp);
return 0;
}
static void __lpfc_cpuhp_remove(struct lpfc_hba *phba)
......@@ -11314,7 +11320,9 @@ static int lpfc_cpu_offline(unsigned int cpu, struct hlist_node *node)
lpfc_irq_rebalance(phba, cpu, true);
lpfc_cpuhp_get_eq(phba, cpu, &eqlist);
retval = lpfc_cpuhp_get_eq(phba, cpu, &eqlist);
if (retval)
return retval;
/* start polling on these eq's */
list_for_each_entry_safe(eq, next, &eqlist, _poll_list) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册