From: Bart Van Assche <bvanassche@xxxxxxx> 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> Signed-off-by: James Smart <jsmart2021@xxxxxxxxx> --- Barts patch slightly reorged to clear the mask before exiting --- drivers/scsi/lpfc/lpfc_init.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index 28e6a763f106..480d5a28c4f5 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) -- 2.13.7