From: Darren Hart <dvhart@infradead.org>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Platform Driver <platform-driver-x86@vger.kernel.org>,
AceLan Kao <acelan.kao@canonical.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v1 1/2] platform/x86: intel-vbtn: Remove redundant inclusions
Date: Wed, 31 Jan 2018 11:04:32 -0800 [thread overview]
Message-ID: <20180131190432.GF8676@fury> (raw)
In-Reply-To: <CAHp75VdFh06kL=4fpoKogyX6K08SyX1zkJOjzmVcGqUWFA+2Ew@mail.gmail.com>
On Wed, Jan 31, 2018 at 08:59:20PM +0200, Andy Shevchenko wrote:
> On Wed, Jan 31, 2018 at 8:50 PM, Darren Hart <dvhart@infradead.org> wrote:
> > On Wed, Jan 31, 2018 at 07:54:06PM +0200, Andy Shevchenko wrote:
> >> Some headers are not needed since the driver can be built as module.
> >> Remove them.
> >
> > Removing init because it's included by module.h, and removing acpi_bus.h
> > because it's included by acpi.h - but not because it can be built as a
> > module - right? Just checking, the wording in the commit msg seemed odd
> > to me.
>
> Correct. I'll rephrase this in place.
>
> > These removals seem appropriate to me, but so we have it recorded here -
> > in general, including headers that you explicitly make use of is good
> > practice, and not depending on others to include them. But in this case,
> > the implicit includes are reasonable expectations as they are tightly
> > coupled with the parent include.
>
> There are two classes of headers (at least?):
> - let say "user-visible" ones, which drivers usually include like you
> pointed above
> - low level ones, which in most cases are not supposed to be included directly
>
> So, for first class I agree with you, and acpi_bus.h in this case can
> be considered as an example of second class.
Agreed, acpi_bus.h is tightly coupled with acpi.h. The practice I've
seen from others and want to discourage / avoid is including acpi.h and
then deleting ... say... spinlock.h because somewhere somehow acpi.h
also pulls it in. They are not tightly coupled conceptually, so
spinlock.h should remain in the include list if the file uses spinlocks
directly. I think we're in violent agreement here :-)
--
Darren Hart
VMware Open Source Technology Center
next prev parent reply other threads:[~2018-01-31 19:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-31 17:54 [PATCH v1 1/2] platform/x86: intel-vbtn: Remove redundant inclusions Andy Shevchenko
2018-01-31 17:54 ` [PATCH v1 2/2] platform/x86: intel-vbtn: Replace License by SDPX identifier Andy Shevchenko
2018-01-31 18:51 ` Darren Hart
2018-01-31 18:50 ` [PATCH v1 1/2] platform/x86: intel-vbtn: Remove redundant inclusions Darren Hart
2018-01-31 18:59 ` Andy Shevchenko
2018-01-31 19:04 ` Darren Hart [this message]
2018-02-05 16:23 ` Andy Shevchenko
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=20180131190432.GF8676@fury \
--to=dvhart@infradead.org \
--cc=acelan.kao@canonical.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=andy.shevchenko@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox