* [PATCH] gpiolib: consumer.h: Move forward declarations outside #ifdef
@ 2014-02-04 12:42 Lars-Peter Clausen
2014-02-05 1:24 ` Alexandre Courbot
2014-02-06 9:23 ` Linus Walleij
0 siblings, 2 replies; 3+ messages in thread
From: Lars-Peter Clausen @ 2014-02-04 12:42 UTC (permalink / raw)
To: Linus Walleij, Alexandre Courbot; +Cc: linux-gpio, Lars-Peter Clausen
Make sure that the forward declared structs in gpio/consumer.h are also visible
on the else branch of the CONFIG_GPIOLIB #ifdef.
Fixes the following warnings and their associated errors when CONFIG_GPIOLIB is
not selected:
include/linux/gpio/consumer.h:67:14: warning: 'struct device' declared inside parameter list
include/linux/gpio/consumer.h:67:14: warning: its scope is only this definition or declaration, which is probably not what you want
[...]
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
include/linux/gpio/consumer.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h
index 4d34dbb..7a8144f 100644
--- a/include/linux/gpio/consumer.h
+++ b/include/linux/gpio/consumer.h
@@ -4,8 +4,6 @@
#include <linux/err.h>
#include <linux/kernel.h>
-#ifdef CONFIG_GPIOLIB
-
struct device;
struct gpio_chip;
@@ -18,6 +16,8 @@ struct gpio_chip;
*/
struct gpio_desc;
+#ifdef CONFIG_GPIOLIB
+
/* Acquire and dispose GPIOs */
struct gpio_desc *__must_check gpiod_get(struct device *dev,
const char *con_id);
--
1.8.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] gpiolib: consumer.h: Move forward declarations outside #ifdef
2014-02-04 12:42 [PATCH] gpiolib: consumer.h: Move forward declarations outside #ifdef Lars-Peter Clausen
@ 2014-02-05 1:24 ` Alexandre Courbot
2014-02-06 9:23 ` Linus Walleij
1 sibling, 0 replies; 3+ messages in thread
From: Alexandre Courbot @ 2014-02-05 1:24 UTC (permalink / raw)
To: Lars-Peter Clausen
Cc: Linus Walleij, Alexandre Courbot, linux-gpio@vger.kernel.org
On Tue, Feb 4, 2014 at 9:42 PM, Lars-Peter Clausen <lars@metafoo.de> wrote:
> Make sure that the forward declared structs in gpio/consumer.h are also visible
> on the else branch of the CONFIG_GPIOLIB #ifdef.
>
> Fixes the following warnings and their associated errors when CONFIG_GPIOLIB is
> not selected:
> include/linux/gpio/consumer.h:67:14: warning: 'struct device' declared inside parameter list
> include/linux/gpio/consumer.h:67:14: warning: its scope is only this definition or declaration, which is probably not what you want
> [...]
>
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] gpiolib: consumer.h: Move forward declarations outside #ifdef
2014-02-04 12:42 [PATCH] gpiolib: consumer.h: Move forward declarations outside #ifdef Lars-Peter Clausen
2014-02-05 1:24 ` Alexandre Courbot
@ 2014-02-06 9:23 ` Linus Walleij
1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2014-02-06 9:23 UTC (permalink / raw)
To: Lars-Peter Clausen; +Cc: Alexandre Courbot, linux-gpio@vger.kernel.org
On Tue, Feb 4, 2014 at 1:42 PM, Lars-Peter Clausen <lars@metafoo.de> wrote:
> Make sure that the forward declared structs in gpio/consumer.h are also visible
> on the else branch of the CONFIG_GPIOLIB #ifdef.
>
> Fixes the following warnings and their associated errors when CONFIG_GPIOLIB is
> not selected:
> include/linux/gpio/consumer.h:67:14: warning: 'struct device' declared inside parameter list
> include/linux/gpio/consumer.h:67:14: warning: its scope is only this definition or declaration, which is probably not what you want
> [...]
>
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Applied for fixes with Alexandre's ACK, thanks!
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-02-06 9:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-04 12:42 [PATCH] gpiolib: consumer.h: Move forward declarations outside #ifdef Lars-Peter Clausen
2014-02-05 1:24 ` Alexandre Courbot
2014-02-06 9:23 ` Linus Walleij
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).