[Artful][PATCH 08/12] powerpc/powernv: Fix build error in opal-imc.c when NUMA=n

Gustavo Walbon gwalbon at linux.vnet.ibm.com
Thu Nov 2 14:04:57 UTC 2017

From: LABBE Corentin <clabbe.montjoie at gmail.com>

BugLink: https://bugs.launchpad.net/bugs/1481347

When building a random powerpc kernel I hit this build error:

  arch/powerpc/platforms/powernv/opal-imc.c:130:13: error : assignment
  discards « const » qualifier from pointer target type
     l_cpumask = cpumask_of_node(nid);

This happens because when CONFIG_NUMA=n cpumask_of_node() returns a
const pointer.

This patch simply adds const to l_cpumask to fix this issue.

Signed-off-by: Corentin Labbe <clabbe.montjoie at gmail.com>
Reviewed-by: Madhavan Srinivasan <maddy at linux.vnet.ibm.com>
[mpe: Flesh out change log]
Signed-off-by: Michael Ellerman <mpe at ellerman.id.au>
(cherry-picked from 6538ac30841638b2fd345725a9fd155c6fe1768a)
Signed-off-by: Gustavo Walbon <gwalbon at linux.vnet.ibm.com>
 arch/powerpc/platforms/powernv/opal-imc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/powernv/opal-imc.c b/arch/powerpc/platforms/powernv/opal-imc.c
index b903bf5e6006..21f6531fae20 100644
--- a/arch/powerpc/platforms/powernv/opal-imc.c
+++ b/arch/powerpc/platforms/powernv/opal-imc.c
@@ -123,7 +123,7 @@ static int imc_pmu_create(struct device_node *parent, int pmu_index, int domain)
 static void disable_nest_pmu_counters(void)
 	int nid, cpu;
-	struct cpumask *l_cpumask;
+	const struct cpumask *l_cpumask;
 	for_each_online_node(nid) {

More information about the kernel-team mailing list