Avoid kernel.h inclusion
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.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 2 lines · Andy Shevchenko
I started cleaning up
kernel.hmess and noticed that GPIO subsystem headers are highly utilizekernel.h. Can we get rid ofkernel.hinclusion in this cycle?
Yeah patches welcome :) I might not have the time to fix it myself.
Yours,
Linus Walleij