powerpc/setup: cleanup ifdef mess in check_cache_coherency()
authorChristophe Leroy <christophe.leroy@c-s.fr>
Fri, 22 Mar 2019 08:08:43 +0000 (08:08 +0000)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 2 May 2019 15:58:11 +0000 (01:58 +1000)
Use IS_ENABLED() instead of #ifdefs

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/kernel/setup-common.c

index 3cb3774f380a615273d64ea6a80b9cc6ac66d85e..6d3ebc40d21c07152fde58179c40d9c5118cbddf 100644 (file)
@@ -737,23 +737,19 @@ void __init setup_panic(void)
  * BUG() in that case.
  */
 
-#ifdef CONFIG_NOT_COHERENT_CACHE
-#define KERNEL_COHERENCY       0
-#else
-#define KERNEL_COHERENCY       1
-#endif
+#define KERNEL_COHERENCY       (!IS_ENABLED(CONFIG_NOT_COHERENT_CACHE))
 
 static int __init check_cache_coherency(void)
 {
        struct device_node *np;
        const void *prop;
-       int devtree_coherency;
+       bool devtree_coherency;
 
        np = of_find_node_by_path("/");
        prop = of_get_property(np, "coherency-off", NULL);
        of_node_put(np);
 
-       devtree_coherency = prop ? 0 : 1;
+       devtree_coherency = prop ? false : true;
 
        if (devtree_coherency != KERNEL_COHERENCY) {
                printk(KERN_ERR