powerpc/powernv: Fix build error in opal-imc.c when NUMA=n
authorLABBE Corentin <clabbe.montjoie@gmail.com>
Wed, 16 Aug 2017 12:34:44 +0000 (14:34 +0200)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 28 Aug 2017 12:09:57 +0000 (22:09 +1000)
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
  [-Werror=discarded-qualifiers]
     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@gmail.com>
Reviewed-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
[mpe: Flesh out change log]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/platforms/powernv/opal-imc.c

index b903bf5e60064b13d808a488eb54858318a75c29..21f6531fae20fc1e010f499923cde964540b895a 100644 (file)
@@ -123,7 +123,7 @@ free_pmu:
 static void disable_nest_pmu_counters(void)
 {
        int nid, cpu;
-       struct cpumask *l_cpumask;
+       const struct cpumask *l_cpumask;
 
        get_online_cpus();
        for_each_online_node(nid) {