* [PATCH v1 1/2] platform/x86: intel-vbtn: Remove redundant inclusions @ 2018-01-31 17:54 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:50 ` [PATCH v1 1/2] platform/x86: intel-vbtn: Remove redundant inclusions Darren Hart 0 siblings, 2 replies; 7+ messages in thread From: Andy Shevchenko @ 2018-01-31 17:54 UTC (permalink / raw) To: Darren Hart, platform-driver-x86, AceLan Kao, linux-kernel Cc: Andy Shevchenko Some headers are not needed since the driver can be built as module. Remove them. While here, sort headers alphabetically. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> --- drivers/platform/x86/intel-vbtn.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/platform/x86/intel-vbtn.c b/drivers/platform/x86/intel-vbtn.c index 101c100a3929..69bc39f8d61d 100644 --- a/drivers/platform/x86/intel-vbtn.c +++ b/drivers/platform/x86/intel-vbtn.c @@ -16,15 +16,13 @@ * */ +#include <linux/acpi.h> +#include <linux/input.h> +#include <linux/input/sparse-keymap.h> #include <linux/kernel.h> #include <linux/module.h> -#include <linux/init.h> -#include <linux/input.h> #include <linux/platform_device.h> -#include <linux/input/sparse-keymap.h> -#include <linux/acpi.h> #include <linux/suspend.h> -#include <acpi/acpi_bus.h> /* When NOT in tablet mode, VGBS returns with the flag 0x40 */ #define TABLET_MODE_FLAG 0x40 -- 2.15.1 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v1 2/2] platform/x86: intel-vbtn: Replace License by SDPX identifier 2018-01-31 17:54 [PATCH v1 1/2] platform/x86: intel-vbtn: Remove redundant inclusions Andy Shevchenko @ 2018-01-31 17:54 ` 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 1 sibling, 1 reply; 7+ messages in thread From: Andy Shevchenko @ 2018-01-31 17:54 UTC (permalink / raw) To: Darren Hart, platform-driver-x86, AceLan Kao, linux-kernel Cc: Andy Shevchenko Replace License short header by SPDX identifier. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> --- drivers/platform/x86/intel-vbtn.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/platform/x86/intel-vbtn.c b/drivers/platform/x86/intel-vbtn.c index 69bc39f8d61d..b703d6f5b099 100644 --- a/drivers/platform/x86/intel-vbtn.c +++ b/drivers/platform/x86/intel-vbtn.c @@ -1,19 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Intel Virtual Button driver for Windows 8.1+ * * Copyright (C) 2016 AceLan Kao <acelan.kao@canonical.com> * Copyright (C) 2016 Alex Hung <alex.hung@canonical.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * */ #include <linux/acpi.h> -- 2.15.1 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v1 2/2] platform/x86: intel-vbtn: Replace License by SDPX identifier 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 0 siblings, 0 replies; 7+ messages in thread From: Darren Hart @ 2018-01-31 18:51 UTC (permalink / raw) To: Andy Shevchenko; +Cc: platform-driver-x86, AceLan Kao, linux-kernel On Wed, Jan 31, 2018 at 07:54:07PM +0200, Andy Shevchenko wrote: > Replace License short header by SPDX identifier. > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Darren Hart (VMware) <dvhart@infradead.org> > --- > drivers/platform/x86/intel-vbtn.c | 12 +----------- > 1 file changed, 1 insertion(+), 11 deletions(-) > > diff --git a/drivers/platform/x86/intel-vbtn.c b/drivers/platform/x86/intel-vbtn.c > index 69bc39f8d61d..b703d6f5b099 100644 > --- a/drivers/platform/x86/intel-vbtn.c > +++ b/drivers/platform/x86/intel-vbtn.c > @@ -1,19 +1,9 @@ > +// SPDX-License-Identifier: GPL-2.0+ > /* > * Intel Virtual Button driver for Windows 8.1+ > * > * Copyright (C) 2016 AceLan Kao <acelan.kao@canonical.com> > * Copyright (C) 2016 Alex Hung <alex.hung@canonical.com> > - * > - * This program is free software; you can redistribute it and/or modify > - * it under the terms of the GNU General Public License as published by > - * the Free Software Foundation; either version 2 of the License, or > - * (at your option) any later version. > - * > - * This program is distributed in the hope that it will be useful, > - * but WITHOUT ANY WARRANTY; without even the implied warranty of > - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > - * GNU General Public License for more details. > - * > */ > > #include <linux/acpi.h> > -- > 2.15.1 > > -- Darren Hart VMware Open Source Technology Center ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v1 1/2] platform/x86: intel-vbtn: Remove redundant inclusions 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:50 ` Darren Hart 2018-01-31 18:59 ` Andy Shevchenko 1 sibling, 1 reply; 7+ messages in thread From: Darren Hart @ 2018-01-31 18:50 UTC (permalink / raw) To: Andy Shevchenko; +Cc: platform-driver-x86, AceLan Kao, linux-kernel 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. 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. Reviewed-by: Darren Hart (VMware) <dvhart@infradead.org> > > While here, sort headers alphabetically. > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> > --- > drivers/platform/x86/intel-vbtn.c | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) > > diff --git a/drivers/platform/x86/intel-vbtn.c b/drivers/platform/x86/intel-vbtn.c > index 101c100a3929..69bc39f8d61d 100644 > --- a/drivers/platform/x86/intel-vbtn.c > +++ b/drivers/platform/x86/intel-vbtn.c > @@ -16,15 +16,13 @@ > * > */ > > +#include <linux/acpi.h> > +#include <linux/input.h> > +#include <linux/input/sparse-keymap.h> > #include <linux/kernel.h> > #include <linux/module.h> > -#include <linux/init.h> > -#include <linux/input.h> > #include <linux/platform_device.h> > -#include <linux/input/sparse-keymap.h> > -#include <linux/acpi.h> > #include <linux/suspend.h> > -#include <acpi/acpi_bus.h> > > /* When NOT in tablet mode, VGBS returns with the flag 0x40 */ > #define TABLET_MODE_FLAG 0x40 > -- > 2.15.1 > > -- Darren Hart VMware Open Source Technology Center ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v1 1/2] platform/x86: intel-vbtn: Remove redundant inclusions 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 0 siblings, 1 reply; 7+ messages in thread From: Andy Shevchenko @ 2018-01-31 18:59 UTC (permalink / raw) To: Darren Hart Cc: Andy Shevchenko, Platform Driver, AceLan Kao, Linux Kernel Mailing List 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. > Reviewed-by: Darren Hart (VMware) <dvhart@infradead.org> Thanks! -- With Best Regards, Andy Shevchenko ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v1 1/2] platform/x86: intel-vbtn: Remove redundant inclusions 2018-01-31 18:59 ` Andy Shevchenko @ 2018-01-31 19:04 ` Darren Hart 2018-02-05 16:23 ` Andy Shevchenko 0 siblings, 1 reply; 7+ messages in thread From: Darren Hart @ 2018-01-31 19:04 UTC (permalink / raw) To: Andy Shevchenko Cc: Andy Shevchenko, Platform Driver, AceLan Kao, Linux Kernel Mailing List 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 ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v1 1/2] platform/x86: intel-vbtn: Remove redundant inclusions 2018-01-31 19:04 ` Darren Hart @ 2018-02-05 16:23 ` Andy Shevchenko 0 siblings, 0 replies; 7+ messages in thread From: Andy Shevchenko @ 2018-02-05 16:23 UTC (permalink / raw) To: Darren Hart, Andy Shevchenko Cc: Platform Driver, AceLan Kao, Linux Kernel Mailing List On Wed, 2018-01-31 at 11:04 -0800, Darren Hart wrote: > 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. My gosh, I forgot to do this and can't rebase anymore. Sorry. > > > 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 :-) It's a problem of header organization I think. AFAIK Plan 9 has an idea that each header is independent, and each C module has to include headers in appropriate order. (Always trade off between flexibility and strict hierarchy). -- Andy Shevchenko <andriy.shevchenko@linux.intel.com> Intel Finland Oy ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2018-02-05 16:23 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 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 2018-02-05 16:23 ` Andy Shevchenko
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox