From: Bart Van Assche <bvanassche@acm.org>
To: "Martin K . Petersen" <martin.petersen@oracle.com>,
"James E . J . Bottomley" <jejb@linux.vnet.ibm.com>
Cc: James Smart <jsmart2021@gmail.com>,
linux-scsi@vger.kernel.org, Bart Van Assche <bvanassche@acm.org>
Subject: [PATCH 3/3] lpfc: Fix lpfc_cpumask_of_node_init()
Date: Wed, 6 Nov 2019 21:21:58 -0800 [thread overview]
Message-ID: <20191107052158.25788-6-bvanassche@acm.org> (raw)
In-Reply-To: <20191107052158.25788-1-bvanassche@acm.org>
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@acm.org>
---
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
next prev parent reply other threads:[~2019-11-07 5:22 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-07 5:21 [PATCH 0/3] Three lpfc fixes Bart Van Assche
2019-11-07 5:21 ` [PATCH 1/3] lpfc: Fix a kernel warning triggered by lpfc_get_sgl_per_hdwq() Bart Van Assche
2019-11-08 22:36 ` James Smart
2019-11-07 5:21 ` [PATCH 1/2] qla2xxx: Remove an include directive Bart Van Assche
2019-11-07 5:21 ` [PATCH 2/3] lpfc: Fix a kernel warning triggered by lpfc_sli4_enable_intr() Bart Van Assche
2019-11-08 22:39 ` James Smart
2019-11-07 5:21 ` [PATCH 2/2] qla2xxx: Fix a dma_pool_free() call Bart Van Assche
2019-11-07 5:21 ` Bart Van Assche [this message]
2019-11-08 22:43 ` [PATCH 3/3] lpfc: Fix lpfc_cpumask_of_node_init() James Smart
2019-11-09 2:49 ` Bart Van Assche
2019-11-09 2:31 ` [PATCH 0/3] Three lpfc fixes Martin K. Petersen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191107052158.25788-6-bvanassche@acm.org \
--to=bvanassche@acm.org \
--cc=jejb@linux.vnet.ibm.com \
--cc=jsmart2021@gmail.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).