Skip to contentSkip to conversation

gpio: include linux/bug.h in interface header

PATCH In review Arnd Bergmann 3 participants 3 messages May 8, 2014 – May 13, 2014 GPIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpio: include linux/bug.h in interface header

Today's linux-next kernel started showing build errors for the use of WARN_ON in linux/gpio/consumer.h:

In file included from drivers/video/backlight/pwm_bl.c:13:0:
include/linux/gpio/consumer.h: In function 'gpiod_put':
include/linux/gpio/consumer.h:81:2: error: implicit declaration of function 'WARN_ON' [-Werror=implicit-function-declaration]

It's not clear why this never happened before, but this patch fixes it by including the header that contains the defintion of this macro.

include/linux/gpio/consumer.h +1 -0
index bed128e..073b9b1 100644
@@ -1,6 +1,7 @@
 #ifndef __LINUX_GPIO_CONSUMER_H
 #define __LINUX_GPIO_CONSUMER_H
 
+#include <linux/bug.h>
 #include <linux/err.h>
 #include <linux/kernel.h>
 
Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · Arnd Bergmann

Today's linux-next kernel started showing build errors for the use of WARN_ON in linux/gpio/consumer.h:

In file included from drivers/video/backlight/pwm_bl.c:13:0:
include/linux/gpio/consumer.h: In function 'gpiod_put':
include/linux/gpio/consumer.h:81:2: error: implicit declaration of function 'WARN_ON' [-Werror=implicit-function-declaration]

It's not clear why this never happened before, but this patch fixes it by including the header that contains the defintion of this macro.

I guess this went unnoticed because this part of the code is only active if compiled without gpiolib, which is not a very common configuration. Sorry about that.

Quoted 16 lines
include/linux/gpio/consumer.h +1 -0
index bed128e..073b9b1 100644
@@ -1,6 +1,7 @@
  #ifndef __LINUX_GPIO_CONSUMER_H
  #define __LINUX_GPIO_CONSUMER_H
 
+#include <linux/bug.h>
  #include <linux/err.h>
  #include <linux/kernel.h>
 
#2 lore raw
In reply to Arnd Bergmann
Quoted 7 lines · Arnd Bergmann

Today's linux-next kernel started showing build errors for the use of WARN_ON in linux/gpio/consumer.h:

In file included from drivers/video/backlight/pwm_bl.c:13:0:
include/linux/gpio/consumer.h: In function 'gpiod_put':
include/linux/gpio/consumer.h:81:2: error: implicit declaration of function 'WARN_ON' [-Werror=implicit-function-declaration]

Quoted 5 lines

It's not clear why this never happened before, but this patch fixes it by including the header that contains the defintion of this macro.

Patch applied!

Yours,
Linus Walleij