Skip to contentSkip to conversation

gpiolib: add missing include

PATCH In review Bartosz Golaszewski 1 participant 2 messages Feb 7, 2025 GPIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpiolib: add missing include

From: Bartosz Golaszewski <[email protected]>

With some randconfigs I'm seeing the following error:

In file included from drivers/gpio/gpiolib-swnode.c:19:
./include/linux/gpio/consumer.h: In function ‘gpiod_enable_hw_timestamp_ns’:
./include/linux/gpio/consumer.h:557:17: error: implicit declaration of function ‘WARN_ON’ [-Wimplicit-function-declaration]

  557 |                 WARN_ON(desc);
      |                 ^~~~~~~

Pull in bug.h to fix it.

---
 include/linux/gpio/consumer.h | 1 +
 1 file changed, 1 insertion(+)
include/linux/gpio/consumer.h +1 -0
index db2dfbae8edb..0b1acd014186 100644
@@ -3,6 +3,7 @@
 #define __LINUX_GPIO_CONSUMER_H
 
 #include <linux/bits.h>
+#include <linux/bug.h>
 #include <linux/types.h>
 
 struct acpi_device;
Signature · 1 line
2.45.2
#1 lore raw
Quoted 31 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

With some randconfigs I'm seeing the following error:

In file included from drivers/gpio/gpiolib-swnode.c:19:
./include/linux/gpio/consumer.h: In function ‘gpiod_enable_hw_timestamp_ns’:
./include/linux/gpio/consumer.h:557:17: error: implicit declaration of function ‘WARN_ON’ [-Wimplicit-function-declaration]

  557 |                 WARN_ON(desc);
      |                 ^~~~~~~

Pull in bug.h to fix it.

---
 include/linux/gpio/consumer.h | 1 +
 1 file changed, 1 insertion(+)
include/linux/gpio/consumer.h +1 -1
index db2dfbae8edb..0b1acd014186 100644
@@ -3,6 +3,7 @@
 #define __LINUX_GPIO_CONSUMER_H
 
 #include <linux/bits.h>
+#include <linux/bug.h>
 #include <linux/types.h>
 
 struct acpi_device;
--
Quoted 2 lines

2.45.2

Ah, build bot responding to my CONFIG_HTE patch made me realize we already include asm/bug.h for !CONFIG_GPIOLIB. I'll rethink the approach here as we'll need it for the HTE stubs too.

Bart