Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1515659 > unrolled thread

[PATCH 1/2] s390: delete unneeded #include <linux/kconfig.h> from facilities_src.h

Started byMasahiro Yamada <yamada.masahiro@socionext.com>
First post2016-11-06 04:50 +0100
Last post2016-11-08 10:20 +0100
Articles 4 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/2] s390: delete unneeded #include <linux/kconfig.h> from facilities_src.h Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-11-06 04:50 +0100
    Re: [PATCH 1/2] s390: delete unneeded #include <linux/kconfig.h>  from facilities_src.h Paul Bolle <pebolle@tiscali.nl> - 2016-11-07 14:00 +0100
      Re: [PATCH 1/2] s390: delete unneeded #include <linux/kconfig.h> from facilities_src.h Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-11-08 03:00 +0100
        Re: [PATCH 1/2] s390: delete unneeded #include <linux/kconfig.h>  from facilities_src.h Paul Bolle <pebolle@tiscali.nl> - 2016-11-08 10:20 +0100

#1515659 — [PATCH 1/2] s390: delete unneeded #include <linux/kconfig.h> from facilities_src.h

FromMasahiro Yamada <yamada.masahiro@socionext.com>
Date2016-11-06 04:50 +0100
Subject[PATCH 1/2] s390: delete unneeded #include <linux/kconfig.h> from facilities_src.h
Message-ID<sAmD0-8Y-13@gated-at.bofh.it>
The header facilities_src.h is only included from gen_facilities.c
and the tool is compiled with the following extra options:

    HOSTCFLAGS_gen_facilities.o += -Wall $(LINUXINCLUDE)

Please note $(LINUXINCLUDE) is expanded into build options including:

    -include $(srctree)/include/linux/kconfig.h

So, the Makefile always forces the tool to include kconfig.h, i.e.,
the #include <linux/kconfig.h> directive in the header is redundant.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 arch/s390/include/asm/facilities_src.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/s390/include/asm/facilities_src.h b/arch/s390/include/asm/facilities_src.h
index 3b758f6..8b1a692 100644
--- a/arch/s390/include/asm/facilities_src.h
+++ b/arch/s390/include/asm/facilities_src.h
@@ -6,8 +6,6 @@
 #error "This file can only be included by gen_facilities.c"
 #endif
 
-#include <linux/kconfig.h>
-
 struct facility_def {
 	char *name;
 	int *bits;
-- 
1.9.1

[toc] | [next] | [standalone]


#1516092 — Re: [PATCH 1/2] s390: delete unneeded #include <linux/kconfig.h> from facilities_src.h

FromPaul Bolle <pebolle@tiscali.nl>
Date2016-11-07 14:00 +0100
SubjectRe: [PATCH 1/2] s390: delete unneeded #include <linux/kconfig.h> from facilities_src.h
Message-ID<sARGS-3e5-5@gated-at.bofh.it>
In reply to#1515659
On Sun, 2016-11-06 at 12:45 +0900, Masahiro Yamada wrote:
> The header facilities_src.h is only included from gen_facilities.c
> and the tool is compiled with the following extra options:
> 
>     HOSTCFLAGS_gen_facilities.o += -Wall $(LINUXINCLUDE)
> 
> Please note $(LINUXINCLUDE) is expanded into build options including:
> 
>     -include $(srctree)/include/linux/kconfig.h
> 
> So, the Makefile always forces the tool to include kconfig.h, i.e.,
> the #include <linux/kconfig.h> directive in the header is redundant.

As far as I can see the only kernel header that gen_facilities.c is actually
interested in is autoconf.h. (autoconf.h will be included via in kconfig.h.)
So it seems the odd $(LINUXINCLUDE) variable in that Makefile could be
replaced with something like:
    -include $(srctree)/include/generated/autoconf.h


Paul Bolle

[toc] | [prev] | [next] | [standalone]


#1516726

FromMasahiro Yamada <yamada.masahiro@socionext.com>
Date2016-11-08 03:00 +0100
Message-ID<sB3RE-2NH-3@gated-at.bofh.it>
In reply to#1516092
Hi Paul,


2016-11-07 21:52 GMT+09:00 Paul Bolle <pebolle@tiscali.nl>:
> On Sun, 2016-11-06 at 12:45 +0900, Masahiro Yamada wrote:
>> The header facilities_src.h is only included from gen_facilities.c
>> and the tool is compiled with the following extra options:
>>
>>     HOSTCFLAGS_gen_facilities.o += -Wall $(LINUXINCLUDE)
>>
>> Please note $(LINUXINCLUDE) is expanded into build options including:
>>
>>     -include $(srctree)/include/linux/kconfig.h
>>
>> So, the Makefile always forces the tool to include kconfig.h, i.e.,
>> the #include <linux/kconfig.h> directive in the header is redundant.
>
> As far as I can see the only kernel header that gen_facilities.c is actually
> interested in is autoconf.h. (autoconf.h will be included via in kconfig.h.)
> So it seems the odd $(LINUXINCLUDE) variable in that Makefile could be
> replaced with something like:
>     -include $(srctree)/include/generated/autoconf.h


This would break O= build because autoconf.h is a generated file.

Rather, it should be
      -include $(objtree)/include/generated/autoconf.h



I thought of this at first, but I was not quite sure
if the file path include/generated/autoconf.h is a guaranteed interface.


Basically, now we are supposed to include autoconf.h via kconfig.h.

So, I thought $(LINUXINCLUDE) is a more stable interface
than specifying the exact path to autoconf.h

I doubt that nobody would try to change it, but it is just two my cents.

Anyway, arch/x86/boot/Makefile already
referenced the path to autoconf.h


So, if you want to change it, I will not oppose to it.



-- 
Best Regards
Masahiro Yamada

[toc] | [prev] | [next] | [standalone]


#1516987 — Re: [PATCH 1/2] s390: delete unneeded #include <linux/kconfig.h> from facilities_src.h

FromPaul Bolle <pebolle@tiscali.nl>
Date2016-11-08 10:20 +0100
SubjectRe: [PATCH 1/2] s390: delete unneeded #include <linux/kconfig.h> from facilities_src.h
Message-ID<sBaJs-7rN-33@gated-at.bofh.it>
In reply to#1516726
Hi Mashiro,

On Tue, 2016-11-08 at 10:50 +0900, Masahiro Yamada wrote:
> 2016-11-07 21:52 GMT+09:00 Paul Bolle <pebolle@tiscali.nl>:
> > So it seems the odd $(LINUXINCLUDE) variable in that Makefile could be
> > replaced with something like:
> >     -include $(srctree)/include/generated/autoconf.h
> 
> This would break O= build because autoconf.h is a generated file.
> 
> Rather, it should be
>       -include $(objtree)/include/generated/autoconf.h

Three cheers for weasel words like "something like"!

> I thought of this at first, but I was not quite sure
> if the file path include/generated/autoconf.h is a guaranteed interface.
> 
> Basically, now we are supposed to include autoconf.h via kconfig.h.

Yes, that seems to go back to commit 2a11c8ea20bf ("kconfig: Introduce
IS_ENABLED(), IS_BUILTIN() and IS_MODULE()"). And when the current approach to
the IS_*() macros was introduced - with that breathtaking hack that introduced
__is_defined() - this was no longer needed but was not changed again.

> So, I thought $(LINUXINCLUDE) is a more stable interface
> than specifying the exact path to autoconf.h
> 
> I doubt that nobody would try to change it, but it is just two my cents.

A bit of cruft accumulated around LINUXINCLUDE: a few dubious uses of it (and
I think this is one of those); typos (ie, LINUX_INCLUDE); the pointless
USERINCLUDE; things like that. It would be nice to remove that cruft. But it
needs to be done carefully.

> Anyway, arch/x86/boot/Makefile already
> referenced the path to autoconf.h
> 
> So, if you want to change it, I will not oppose to it.


Paul Bolle

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web