Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

powerpc/prom_init: Use IS_ENABLED()

Use IS_ENABLED() for the device tree checks, so that more code is
checked by the compiler without having to build all the different
configurations.

Suggested-by: Rob Herring <robh@kernel.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/20241218113159.422821-1-mpe@ellerman.id.au

authored by

Michael Ellerman and committed by
Madhavan Srinivasan
200f22fa 8f70caad

+14 -25
+14 -25
arch/powerpc/kernel/prom_init.c
··· 2792 2792 dt_struct_start, dt_struct_end); 2793 2793 } 2794 2794 2795 - #ifdef CONFIG_PPC_CHRP 2796 2795 /* 2797 2796 * Pegasos and BriQ lacks the "ranges" property in the isa node 2798 2797 * Pegasos needs decimal IRQ 14/15, not hexadecimal ··· 2842 2843 } 2843 2844 } 2844 2845 } 2845 - #else 2846 - #define fixup_device_tree_chrp() 2847 - #endif 2848 2846 2849 - #if defined(CONFIG_PPC64) && defined(CONFIG_PPC_PMAC) 2850 2847 static void __init fixup_device_tree_pmac64(void) 2851 2848 { 2852 2849 phandle u3, i2c, mpic; ··· 2882 2887 prom_setprop(i2c, "/u3@0,f8000000/i2c@f8001000", "interrupt-parent", 2883 2888 &parent, sizeof(parent)); 2884 2889 } 2885 - #else 2886 - #define fixup_device_tree_pmac64() 2887 - #endif 2888 2890 2889 - #ifdef CONFIG_PPC_PMAC 2890 2891 static void __init fixup_device_tree_pmac(void) 2891 2892 { 2892 2893 __be32 val = 1; ··· 2902 2911 prom_setprop(node, NULL, "#size-cells", &val, sizeof(val)); 2903 2912 } 2904 2913 } 2905 - #else 2906 - static inline void fixup_device_tree_pmac(void) { } 2907 - #endif 2908 2914 2909 - #ifdef CONFIG_PPC_EFIKA 2910 2915 /* 2911 2916 * The MPC5200 FEC driver requires an phy-handle property to tell it how 2912 2917 * to talk to the phy. If the phy-handle property is missing, then this ··· 3034 3047 /* Make sure ethernet phy-handle property exists */ 3035 3048 fixup_device_tree_efika_add_phy(); 3036 3049 } 3037 - #else 3038 - #define fixup_device_tree_efika() 3039 - #endif 3040 3050 3041 - #ifdef CONFIG_PPC_PASEMI_NEMO 3042 3051 /* 3043 3052 * CFE supplied on Nemo is broken in several ways, biggest 3044 3053 * problem is that it reassigns ISA interrupts to unused mpic ints. ··· 3110 3127 3111 3128 prom_setprop(iob, name, "device_type", "isa", sizeof("isa")); 3112 3129 } 3113 - #else /* !CONFIG_PPC_PASEMI_NEMO */ 3114 - static inline void fixup_device_tree_pasemi(void) { } 3115 - #endif 3116 3130 3117 3131 static void __init fixup_device_tree(void) 3118 3132 { 3119 - fixup_device_tree_chrp(); 3120 - fixup_device_tree_pmac(); 3121 - fixup_device_tree_pmac64(); 3122 - fixup_device_tree_efika(); 3123 - fixup_device_tree_pasemi(); 3133 + if (IS_ENABLED(CONFIG_PPC_CHRP)) 3134 + fixup_device_tree_chrp(); 3135 + 3136 + if (IS_ENABLED(CONFIG_PPC_PMAC)) 3137 + fixup_device_tree_pmac(); 3138 + 3139 + if (IS_ENABLED(CONFIG_PPC_PMAC) && IS_ENABLED(CONFIG_PPC64)) 3140 + fixup_device_tree_pmac64(); 3141 + 3142 + if (IS_ENABLED(CONFIG_PPC_EFIKA)) 3143 + fixup_device_tree_efika(); 3144 + 3145 + if (IS_ENABLED(CONFIG_PPC_PASEMI_NEMO)) 3146 + fixup_device_tree_pasemi(); 3124 3147 } 3125 3148 3126 3149 static void __init prom_find_boot_cpu(void)