Avoid kernel.h inclusion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!

I started cleaning up kernel.h mess and noticed that GPIO subsystem headers are
highly utilize kernel.h. Can we get rid of kernel.h inclusion in this cycle?

$ git grep -n -w '#include <linux/kernel.h>' -- include/ | grep gpio
include/asm-generic/gpio.h:5:#include <linux/kernel.h>
include/linux/gpio.h:102:#include <linux/kernel.h>
include/linux/gpio/consumer.h:7:#include <linux/kernel.h>
include/linux/of_gpio.h:14:#include <linux/kernel.h>

Currently, for example, I commented out log2.h and bitops.h in kernel.h (for testing purposes) and immediately got

include/linux/gpio/consumer.h:38:34: error: implicit declaration of function ‘BIT’ [-Werror=implicit-function-declaration]
   38 | #define GPIOD_FLAGS_BIT_DIR_SET  BIT(0)
      |                                  ^~~
...
include/linux/gpio/consumer.h:55:2: error: enumerator value for ‘GPIOD_OUT_HIGH_OPEN_DRAIN’ is not an integer constant
   55 |  GPIOD_OUT_HIGH_OPEN_DRAIN = GPIOD_OUT_HIGH | GPIOD_FLAGS_BIT_OPEN_DRAIN,
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~

Obviously consumer.h is user of bits.h.

-- 
With Best Regards,
Andy Shevchenko





[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux