summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-12-18 11:00:56 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2016-12-18 11:00:56 -0800
commiteb3a3c074624fdae82a09e77740c131f85299d67 (patch)
tree83b2d4dd3e59236a5215d97d6269920e469d8761 /kernel
parent52f40e9d657cc126b766304a5dd58ad73b02ff46 (diff)
parentc0af52437254fda8b0cdbaae5a9b6d9327f1fcd5 (diff)
downloadlwn-eb3a3c074624fdae82a09e77740c131f85299d67.tar.gz
lwn-eb3a3c074624fdae82a09e77740c131f85299d67.zip
Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull irq fix from Thomas Gleixner: "A fix for the irq affinity spread algorithm so it handles non linear node numbering nicely" * 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: genirq/affinity: Fix node generation from cpumask
Diffstat (limited to 'kernel')
-rw-r--r--kernel/irq/affinity.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/irq/affinity.c b/kernel/irq/affinity.c
index 9be9bda7c1f9..4544b115f5eb 100644
--- a/kernel/irq/affinity.c
+++ b/kernel/irq/affinity.c
@@ -37,10 +37,10 @@ static void irq_spread_init_one(struct cpumask *irqmsk, struct cpumask *nmsk,
static int get_nodes_in_cpumask(const struct cpumask *mask, nodemask_t *nodemsk)
{
- int n, nodes;
+ int n, nodes = 0;
/* Calculate the number of nodes in the supplied affinity mask */
- for (n = 0, nodes = 0; n < num_online_nodes(); n++) {
+ for_each_online_node(n) {
if (cpumask_intersects(mask, cpumask_of_node(n))) {
node_set(n, *nodemsk);
nodes++;
@@ -82,7 +82,7 @@ irq_create_affinity_masks(int nvecs, const struct irq_affinity *affd)
nodes = get_nodes_in_cpumask(cpu_online_mask, &nodemsk);
/*
- * If the number of nodes in the mask is less than or equal the
+ * If the number of nodes in the mask is greater than or equal the
* number of vectors we just spread the vectors across the nodes.
*/
if (affv <= nodes) {