summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBart Van Assche <bvanassche@acm.org>2019-11-08 14:59:47 -0800
committerMartin K. Petersen <martin.petersen@oracle.com>2019-11-08 21:29:42 -0500
commit61951a6d3153b4482404b739be921a7459f8dc12 (patch)
tree65427b4496f1cdb0c0bc0602115ef847bf31cc8c
parenteea2d396aa57acb3607f79ef04c08c2c5166f3fa (diff)
scsi: lpfc: Fix lpfc_cpumask_of_node_init()
Fix the following kernel warning: cpumask_of_node(-1): (unsigned)node >= nr_node_ids(1) Fixes: dcaa21367938 ("scsi: lpfc: Change default IRQ model on AMD architectures") Link: https://lore.kernel.org/r/20191108225947.1395-1-jsmart2021@gmail.com Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: James Smart <jsmart2021@gmail.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r--drivers/scsi/lpfc/lpfc_init.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 37e57fd9ba5d..303bfff0ecc8 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -6005,19 +6005,13 @@ static void
lpfc_cpumask_of_node_init(struct lpfc_hba *phba)
{
unsigned int cpu, numa_node;
- struct cpumask *numa_mask = NULL;
-
-#ifdef CONFIG_NUMA
- numa_node = phba->pcidev->dev.numa_node;
-#else
- numa_node = NUMA_NO_NODE;
-#endif
- numa_mask = &phba->sli4_hba.numa_mask;
+ struct cpumask *numa_mask = &phba->sli4_hba.numa_mask;
cpumask_clear(numa_mask);
/* Check if we're a NUMA architecture */
- if (!cpumask_of_node(numa_node))
+ numa_node = dev_to_node(&phba->pcidev->dev);
+ if (numa_node == NUMA_NO_NODE)
return;
for_each_possible_cpu(cpu)