All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Kent Gibson <warthog618@gmail.com>,
	Linus Walleij <linus.walleij@linaro.org>
Cc: linux-gpio@vger.kernel.org,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>
Subject: Avoid kernel.h inclusion
Date: Tue, 4 Feb 2020 19:18:38 +0200	[thread overview]
Message-ID: <20200204171838.GJ10400@smile.fi.intel.com> (raw)

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



             reply	other threads:[~2020-02-04 17:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-04 17:18 Andy Shevchenko [this message]
2020-02-10 11:56 ` Avoid kernel.h inclusion Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200204171838.GJ10400@smile.fi.intel.com \
    --to=andriy.shevchenko@intel.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=warthog618@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.