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") Signed-off-by: Bart Van Assche <bvanassche@xxxxxxx> --- drivers/scsi/lpfc/lpfc_init.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index 37e57fd9ba5d..f2051e2f5f56 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c @@ -6005,21 +6005,14 @@ static void lpfc_cpumask_of_node_init(struct lpfc_hba *phba) { unsigned int cpu, numa_node; - struct cpumask *numa_mask = NULL; + struct cpumask *numa_mask = &phba->sli4_hba.numa_mask; -#ifdef CONFIG_NUMA - numa_node = phba->pcidev->dev.numa_node; -#else - numa_node = NUMA_NO_NODE; -#endif - numa_mask = &phba->sli4_hba.numa_mask; + numa_node = dev_to_node(&phba->pcidev->dev); + if (numa_node == NUMA_NO_NODE) + return; cpumask_clear(numa_mask); - /* Check if we're a NUMA architecture */ - if (!cpumask_of_node(numa_node)) - return; - for_each_possible_cpu(cpu) if (cpu_to_node(cpu) == numa_node) cpumask_set_cpu(cpu, numa_mask); -- 2.23.0