[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <167404184855.4906.755799913850425834.tip-bot2@tip-bot2>
Date: Wed, 18 Jan 2023 11:37:28 -0000
From: "tip-bot2 for Ingo Molnar" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Ming Lei <ming.lei@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...nel.org>, x86@...nel.org,
linux-kernel@...r.kernel.org, maz@...nel.org
Subject: [tip: irq/core] genirq/affinity: Only build SMP-only helper functions
on SMP kernels
The following commit has been merged into the irq/core branch of tip:
Commit-ID: 188a569658584e93930ab60334c5a1079c0330d8
Gitweb: https://git.kernel.org/tip/188a569658584e93930ab60334c5a1079c0330d8
Author: Ingo Molnar <mingo@...nel.org>
AuthorDate: Wed, 18 Jan 2023 12:14:01 +01:00
Committer: Ingo Molnar <mingo@...nel.org>
CommitterDate: Wed, 18 Jan 2023 12:16:47 +01:00
genirq/affinity: Only build SMP-only helper functions on SMP kernels
allnoconfig grew these new build warnings in lib/group_cpus.c:
lib/group_cpus.c:247:12: warning: ‘__group_cpus_evenly’ defined but not used [-Wunused-function]
lib/group_cpus.c:75:13: warning: ‘build_node_to_cpumask’ defined but not used [-Wunused-function]
lib/group_cpus.c:66:13: warning: ‘free_node_to_cpumask’ defined but not used [-Wunused-function]
lib/group_cpus.c:43:23: warning: ‘alloc_node_to_cpumask’ defined but not used [-Wunused-function]
Widen the #ifdef CONFIG_SMP block to not expose unused helpers on
non-SMP builds.
Also annotate the preprocessor branches for better readability.
Fixes: f7b3ea8cf72f ("genirq/affinity: Move group_cpus_evenly() into lib/")
Cc: Ming Lei <ming.lei@...hat.com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Link: https://lore.kernel.org/r/20221227022905.352674-6-ming.lei@redhat.com
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
lib/group_cpus.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/lib/group_cpus.c b/lib/group_cpus.c
index 99f08c6..9c837a3 100644
--- a/lib/group_cpus.c
+++ b/lib/group_cpus.c
@@ -9,6 +9,8 @@
#include <linux/sort.h>
#include <linux/group_cpus.h>
+#ifdef CONFIG_SMP
+
static void grp_spread_init_one(struct cpumask *irqmsk, struct cpumask *nmsk,
unsigned int cpus_per_grp)
{
@@ -327,7 +329,6 @@ static int __group_cpus_evenly(unsigned int startgrp, unsigned int numgrps,
return done;
}
-#ifdef CONFIG_SMP
/**
* group_cpus_evenly - Group all CPUs evenly per NUMA/CPU locality
* @numgrps: number of groups
@@ -412,7 +413,7 @@ struct cpumask *group_cpus_evenly(unsigned int numgrps)
}
return masks;
}
-#else
+#else /* CONFIG_SMP */
struct cpumask *group_cpus_evenly(unsigned int numgrps)
{
struct cpumask *masks = kcalloc(numgrps, sizeof(*masks), GFP_KERNEL);
@@ -424,4 +425,4 @@ struct cpumask *group_cpus_evenly(unsigned int numgrps)
cpumask_copy(&masks[0], cpu_possible_mask);
return masks;
}
-#endif
+#endif /* CONFIG_SMP */
Powered by blists - more mailing lists