Skip to content

Commit ec6516b

Browse files
masahir0yLinus Walleij
authored andcommitted
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>
1 parent d9c238c commit ec6516b

4 files changed

Lines changed: 6 additions & 26 deletions

File tree

‎include/linux/pinctrl/pinconf-generic.h‎

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@
1212
#ifndef __LINUX_PINCTRL_PINCONF_GENERIC_H
1313
#define __LINUX_PINCTRL_PINCONF_GENERIC_H
1414

15+
#include <linux/device.h>
16+
#include <linux/pinctrl/machine.h>
17+
18+
struct pinctrl_dev;
19+
struct pinctrl_map;
20+
1521
/**
1622
* enum pin_config_param - possible pin configuration parameters
1723
* @PIN_CONFIG_BIAS_BUS_HOLD: the pin will be set to weakly latch so that it
@@ -159,9 +165,6 @@ static inline unsigned long pinconf_to_config_packed(enum pin_config_param param
159165
return PIN_CONF_PACKED(param, argument);
160166
}
161167

162-
#ifdef CONFIG_GENERIC_PINCONF
163-
164-
#ifdef CONFIG_DEBUG_FS
165168
#define PCONFDUMP(a, b, c, d) { \
166169
.param = a, .display = b, .format = c, .has_arg = d \
167170
}
@@ -172,14 +175,6 @@ struct pin_config_item {
172175
const char * const format;
173176
bool has_arg;
174177
};
175-
#endif /* CONFIG_DEBUG_FS */
176-
177-
#ifdef CONFIG_OF
178-
179-
#include <linux/device.h>
180-
#include <linux/pinctrl/machine.h>
181-
struct pinctrl_dev;
182-
struct pinctrl_map;
183178

184179
struct pinconf_generic_params {
185180
const char * const property;
@@ -224,8 +219,5 @@ static inline int pinconf_generic_dt_node_to_map_all(
224219
return pinconf_generic_dt_node_to_map(pctldev, np_config, map, num_maps,
225220
PIN_MAP_TYPE_INVALID);
226221
}
227-
#endif
228-
229-
#endif /* CONFIG_GENERIC_PINCONF */
230222

231223
#endif /* __LINUX_PINCTRL_PINCONF_GENERIC_H */

‎include/linux/pinctrl/pinconf.h‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
#ifndef __LINUX_PINCTRL_PINCONF_H
1313
#define __LINUX_PINCTRL_PINCONF_H
1414

15-
#ifdef CONFIG_PINCONF
16-
1715
#include <linux/types.h>
1816

1917
struct pinctrl_dev;
@@ -67,6 +65,4 @@ struct pinconf_ops {
6765
unsigned long config);
6866
};
6967

70-
#endif
71-
7268
#endif /* __LINUX_PINCTRL_PINCONF_H */

‎include/linux/pinctrl/pinctrl.h‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
#ifndef __LINUX_PINCTRL_PINCTRL_H
1313
#define __LINUX_PINCTRL_PINCTRL_H
1414

15-
#ifdef CONFIG_PINCTRL
16-
1715
#include <linux/radix-tree.h>
1816
#include <linux/list.h>
1917
#include <linux/seq_file.h>
@@ -203,6 +201,4 @@ extern const char *pinctrl_dev_get_name(struct pinctrl_dev *pctldev);
203201
extern const char *pinctrl_dev_get_devname(struct pinctrl_dev *pctldev);
204202
extern void *pinctrl_dev_get_drvdata(struct pinctrl_dev *pctldev);
205203

206-
#endif /* !CONFIG_PINCTRL */
207-
208204
#endif /* __LINUX_PINCTRL_PINCTRL_H */

‎include/linux/pinctrl/pinmux.h‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
#include <linux/seq_file.h>
1717
#include <linux/pinctrl/pinctrl.h>
1818

19-
#ifdef CONFIG_PINMUX
20-
2119
struct pinctrl_dev;
2220

2321
/**
@@ -85,6 +83,4 @@ struct pinmux_ops {
8583
bool strict;
8684
};
8785

88-
#endif /* CONFIG_PINMUX */
89-
9086
#endif /* __LINUX_PINCTRL_PINMUX_H */

0 commit comments

Comments
 (0)