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

pinctrl: remove unneeded #ifdef around declarations

What is the point in surrounding the whole of declarations with
ifdef like this?

#ifdef CONFIG_FOO
int foo(void);
#endif

If CONFIG_FOO is not defined, all callers of foo() will fail
with implicit declaration errors since the top Makefile adds
-Werror-implicit-function-declaration to KBUILD_CFLAGS.

This breaks the build earlier when you are doing something wrong.
That's it.

Anyway, it will fail to link since the definition of foo() is not
compiled.

In summary, these ifdef are unneeded.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Masahiro Yamada and committed by
Linus Walleij
ec6516bf d9c238c5

+6 -26
+6 -14
include/linux/pinctrl/pinconf-generic.h
··· 12 12 #ifndef __LINUX_PINCTRL_PINCONF_GENERIC_H 13 13 #define __LINUX_PINCTRL_PINCONF_GENERIC_H 14 14 15 + #include <linux/device.h> 16 + #include <linux/pinctrl/machine.h> 17 + 18 + struct pinctrl_dev; 19 + struct pinctrl_map; 20 + 15 21 /** 16 22 * enum pin_config_param - possible pin configuration parameters 17 23 * @PIN_CONFIG_BIAS_BUS_HOLD: the pin will be set to weakly latch so that it ··· 165 159 return PIN_CONF_PACKED(param, argument); 166 160 } 167 161 168 - #ifdef CONFIG_GENERIC_PINCONF 169 - 170 - #ifdef CONFIG_DEBUG_FS 171 162 #define PCONFDUMP(a, b, c, d) { \ 172 163 .param = a, .display = b, .format = c, .has_arg = d \ 173 164 } ··· 175 172 const char * const format; 176 173 bool has_arg; 177 174 }; 178 - #endif /* CONFIG_DEBUG_FS */ 179 - 180 - #ifdef CONFIG_OF 181 - 182 - #include <linux/device.h> 183 - #include <linux/pinctrl/machine.h> 184 - struct pinctrl_dev; 185 - struct pinctrl_map; 186 175 187 176 struct pinconf_generic_params { 188 177 const char * const property; ··· 219 224 return pinconf_generic_dt_node_to_map(pctldev, np_config, map, num_maps, 220 225 PIN_MAP_TYPE_INVALID); 221 226 } 222 - #endif 223 - 224 - #endif /* CONFIG_GENERIC_PINCONF */ 225 227 226 228 #endif /* __LINUX_PINCTRL_PINCONF_GENERIC_H */
-4
include/linux/pinctrl/pinconf.h
··· 12 12 #ifndef __LINUX_PINCTRL_PINCONF_H 13 13 #define __LINUX_PINCTRL_PINCONF_H 14 14 15 - #ifdef CONFIG_PINCONF 16 - 17 15 #include <linux/types.h> 18 16 19 17 struct pinctrl_dev; ··· 64 66 struct seq_file *s, 65 67 unsigned long config); 66 68 }; 67 - 68 - #endif 69 69 70 70 #endif /* __LINUX_PINCTRL_PINCONF_H */
-4
include/linux/pinctrl/pinctrl.h
··· 12 12 #ifndef __LINUX_PINCTRL_PINCTRL_H 13 13 #define __LINUX_PINCTRL_PINCTRL_H 14 14 15 - #ifdef CONFIG_PINCTRL 16 - 17 15 #include <linux/radix-tree.h> 18 16 #include <linux/list.h> 19 17 #include <linux/seq_file.h> ··· 200 202 extern const char *pinctrl_dev_get_name(struct pinctrl_dev *pctldev); 201 203 extern const char *pinctrl_dev_get_devname(struct pinctrl_dev *pctldev); 202 204 extern void *pinctrl_dev_get_drvdata(struct pinctrl_dev *pctldev); 203 - 204 - #endif /* !CONFIG_PINCTRL */ 205 205 206 206 #endif /* __LINUX_PINCTRL_PINCTRL_H */
-4
include/linux/pinctrl/pinmux.h
··· 16 16 #include <linux/seq_file.h> 17 17 #include <linux/pinctrl/pinctrl.h> 18 18 19 - #ifdef CONFIG_PINMUX 20 - 21 19 struct pinctrl_dev; 22 20 23 21 /** ··· 82 84 bool input); 83 85 bool strict; 84 86 }; 85 - 86 - #endif /* CONFIG_PINMUX */ 87 87 88 88 #endif /* __LINUX_PINCTRL_PINMUX_H */