All of lore.kernel.org
 help / color / mirror / Atom feed
* Avoid kernel.h inclusion
@ 2020-02-04 17:18 Andy Shevchenko
  2020-02-10 11:56 ` Linus Walleij
  0 siblings, 1 reply; 2+ messages in thread
From: Andy Shevchenko @ 2020-02-04 17:18 UTC (permalink / raw)
  To: Kent Gibson, Linus Walleij; +Cc: linux-gpio, Bartosz Golaszewski

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



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Avoid kernel.h inclusion
  2020-02-04 17:18 Avoid kernel.h inclusion Andy Shevchenko
@ 2020-02-10 11:56 ` Linus Walleij
  0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2020-02-10 11:56 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Kent Gibson, open list:GPIO SUBSYSTEM, Bartosz Golaszewski

On Tue, Feb 4, 2020 at 6:18 PM Andy Shevchenko
<andriy.shevchenko@intel.com> wrote:

> 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?

Yeah patches welcome :) I might not have the time to fix it myself.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-02-10 11:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-04 17:18 Avoid kernel.h inclusion Andy Shevchenko
2020-02-10 11:56 ` Linus Walleij

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.