* [PATCH RFC] kconfig.h fix extraneous dependencies
@ 2011-08-01 0:36 Peter Foley
2011-08-01 0:53 ` Arnaud Lacombe
0 siblings, 1 reply; 6+ messages in thread
From: Peter Foley @ 2011-08-01 0:36 UTC (permalink / raw)
To: Linux Kernel Mailing List, Linux Kbuild Mailing List, mmarek,
rdunlap, lacombar
The introduction of kconfig.h caused fixdep to create three extraneous
dependencies.
include/config/.h
include/config/h.h
include/config/foo.h
Remove them by eliminating instances of CONFIG_
Signed-off-by: Peter Foley <pefoley2@verizon.net>
---
Suggestions for a better replacement for CONFIG_FOO would be appreciated.
diff --git a/include/linux/kconfig.h b/include/linux/kconfig.h
index 067eda0..66a0659 100644
--- a/include/linux/kconfig.h
+++ b/include/linux/kconfig.h
@@ -1,15 +1,15 @@
-#ifndef __LINUX_KCONFIG_H
-#define __LINUX_KCONFIG_H
+#ifndef __LINUX_KCONFIG
+#define __LINUX_KCONFIG
#include <generated/autoconf.h>
/*
- * Helper macros to use CONFIG_ options in C expressions. Note that
+ * Helper macros to use CONFIG options in C expressions. Note that
* these only work with boolean and tristate options.
*/
/*
- * IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',
+ * IS_ENABLED(CONFIG _FOO) evaluates to 1 if CONFIG _FOO is set to 'y' or 'm',
* 0 otherwise.
*
*/
@@ -17,16 +17,16 @@
(__enabled_ ## option || __enabled_ ## option ## _MODULE)
/*
- * IS_BUILTIN(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y', 0
+ * IS_BUILTIN(CONFIG _FOO) evaluates to 1 if CONFIG _FOO is set to 'y', 0
* otherwise. For boolean options, this is equivalent to
- * IS_ENABLED(CONFIG_FOO).
+ * IS_ENABLED(CONFIG _FOO).
*/
#define IS_BUILTIN(option) __enabled_ ## option
/*
- * IS_MODULE(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'm', 0
+ * IS_MODULE(CONFIG _FOO) evaluates to 1 if CONFIG _FOO is set to 'm', 0
* otherwise.
*/
#define IS_MODULE(option) __enabled_ ## option ## _MODULE
-#endif /* __LINUX_KCONFIG_H */
+#endif /* __LINUX_KCONFIG */
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH RFC] kconfig.h fix extraneous dependencies
2011-08-01 0:36 [PATCH RFC] kconfig.h fix extraneous dependencies Peter Foley
@ 2011-08-01 0:53 ` Arnaud Lacombe
2011-08-01 1:16 ` Peter Foley
0 siblings, 1 reply; 6+ messages in thread
From: Arnaud Lacombe @ 2011-08-01 0:53 UTC (permalink / raw)
To: Peter Foley
Cc: Linux Kernel Mailing List, Linux Kbuild Mailing List, mmarek,
rdunlap
Hi,
On Sun, Jul 31, 2011 at 8:36 PM, Peter Foley <pefoley2@verizon.net> wrote:
> The introduction of kconfig.h caused fixdep to create three extraneous
> dependencies.
> include/config/.h
> include/config/h.h
> include/config/foo.h
>
> Remove them by eliminating instances of CONFIG_
>
this seems ugly to me... I would rather try to fix fixdep, no ?
- Arnaud
> Signed-off-by: Peter Foley <pefoley2@verizon.net>
> ---
>
> Suggestions for a better replacement for CONFIG_FOO would be appreciated.
>
> diff --git a/include/linux/kconfig.h b/include/linux/kconfig.h
> index 067eda0..66a0659 100644
> --- a/include/linux/kconfig.h
> +++ b/include/linux/kconfig.h
> @@ -1,15 +1,15 @@
> -#ifndef __LINUX_KCONFIG_H
> -#define __LINUX_KCONFIG_H
> +#ifndef __LINUX_KCONFIG
> +#define __LINUX_KCONFIG
>
> #include <generated/autoconf.h>
>
> /*
> - * Helper macros to use CONFIG_ options in C expressions. Note that
> + * Helper macros to use CONFIG options in C expressions. Note that
> * these only work with boolean and tristate options.
> */
>
> /*
> - * IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',
> + * IS_ENABLED(CONFIG _FOO) evaluates to 1 if CONFIG _FOO is set to 'y' or 'm',
> * 0 otherwise.
> *
> */
> @@ -17,16 +17,16 @@
> (__enabled_ ## option || __enabled_ ## option ## _MODULE)
>
> /*
> - * IS_BUILTIN(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y', 0
> + * IS_BUILTIN(CONFIG _FOO) evaluates to 1 if CONFIG _FOO is set to 'y', 0
> * otherwise. For boolean options, this is equivalent to
> - * IS_ENABLED(CONFIG_FOO).
> + * IS_ENABLED(CONFIG _FOO).
> */
> #define IS_BUILTIN(option) __enabled_ ## option
>
> /*
> - * IS_MODULE(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'm', 0
> + * IS_MODULE(CONFIG _FOO) evaluates to 1 if CONFIG _FOO is set to 'm', 0
> * otherwise.
> */
> #define IS_MODULE(option) __enabled_ ## option ## _MODULE
>
> -#endif /* __LINUX_KCONFIG_H */
> +#endif /* __LINUX_KCONFIG */
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH RFC] kconfig.h fix extraneous dependencies
2011-08-01 0:53 ` Arnaud Lacombe
@ 2011-08-01 1:16 ` Peter Foley
2011-08-01 9:24 ` Michal Marek
0 siblings, 1 reply; 6+ messages in thread
From: Peter Foley @ 2011-08-01 1:16 UTC (permalink / raw)
To: Arnaud Lacombe
Cc: Peter Foley, Linux Kernel Mailing List, Linux Kbuild Mailing List,
mmarek, rdunlap
On Sun, 31 Jul 2011, Arnaud Lacombe wrote:
> Hi,
>
> On Sun, Jul 31, 2011 at 8:36 PM, Peter Foley <pefoley2@verizon.net> wrote:
> > The introduction of kconfig.h caused fixdep to create three extraneous
> > dependencies.
> > include/config/.h
> > include/config/h.h
> > include/config/foo.h
> >
> > Remove them by eliminating instances of CONFIG_
> >
> this seems ugly to me... I would rather try to fix fixdep, no ?
>
> - Arnaud
I'd be the first to admit that this patch is a ugly hack.
However, judging by the comments in fixdep.c this is expected behavior.
I'm also afraid that changing fixdep to ignore comments would slow down
the whole build for the sake of one file which IMHO dosen't seem to be a
worthwhile tradeoff.
Thanks,
Peter
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH RFC] kconfig.h fix extraneous dependencies
2011-08-01 1:16 ` Peter Foley
@ 2011-08-01 9:24 ` Michal Marek
2011-08-01 13:51 ` [PATCH v2] " Peter Foley
0 siblings, 1 reply; 6+ messages in thread
From: Michal Marek @ 2011-08-01 9:24 UTC (permalink / raw)
To: Peter Foley
Cc: Arnaud Lacombe, Linux Kernel Mailing List,
Linux Kbuild Mailing List, rdunlap
On 1.8.2011 03:16, Peter Foley wrote:
> On Sun, 31 Jul 2011, Arnaud Lacombe wrote:
>> On Sun, Jul 31, 2011 at 8:36 PM, Peter Foley<pefoley2@verizon.net> wrote:
>>> The introduction of kconfig.h caused fixdep to create three extraneous
>>> dependencies.
>>> include/config/.h
>>> include/config/h.h
>>> include/config/foo.h
>>>
>>> Remove them by eliminating instances of CONFIG_
>>>
>> this seems ugly to me... I would rather try to fix fixdep, no ?
>>
>> - Arnaud
>
> I'd be the first to admit that this patch is a ugly hack.
> However, judging by the comments in fixdep.c this is expected behavior.
And it's also harmless, the source contains thousands of false matches:
$ git grep '_CONFIG_' | wc -l
7989
e.g anything that includes include/linux/acpi.h gets a false dependency
on include/config/support.h because of
include/linux/acpi.h:#define OSC_EXT_PCI_CONFIG_SUPPORT 1
but it doesn't matter.
> I'm also afraid that changing fixdep to ignore comments would slow down
> the whole build for the sake of one file which IMHO dosen't seem to be a
> worthwhile tradeoff.
I would take a patch that makes fixdep ignore include/linux/kconfig.h,
like it ignores include/generated/kconfig.h. Anything more advanced
isn't worth the effort, IMO.
Michal
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2] kconfig.h fix extraneous dependencies
2011-08-01 9:24 ` Michal Marek
@ 2011-08-01 13:51 ` Peter Foley
2011-09-09 9:46 ` Michal Marek
0 siblings, 1 reply; 6+ messages in thread
From: Peter Foley @ 2011-08-01 13:51 UTC (permalink / raw)
To: Michal Marek
Cc: Peter Foley, Arnaud Lacombe, Linux Kernel Mailing List,
Linux Kbuild Mailing List, rdunlap
The introduction of include/linux/kconfig.h created 3 extraneous
dependencies:
include/config/.h
include/config/h.h
include/config/foo.h
Fix this by excluding kconfig.h from fixdep calculations.
Signed-off-by: Peter Foley <pefoley2@verizon.net>
---
diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c
index 291228e..4789a6b 100644
--- a/scripts/basic/fixdep.c
+++ b/scripts/basic/fixdep.c
@@ -345,6 +345,7 @@ static void parse_dep_file(void *map, size_t len)
memcpy(s, m, p-m); s[p-m] = 0;
if (strrcmp(s, "include/generated/autoconf.h") &&
strrcmp(s, "arch/um/include/uml-config.h") &&
+ strrcmp(s, "include/linux/kconfig.h") &&
strrcmp(s, ".ver")) {
/*
* Do not list the source file as dependency, so that
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2] kconfig.h fix extraneous dependencies
2011-08-01 13:51 ` [PATCH v2] " Peter Foley
@ 2011-09-09 9:46 ` Michal Marek
0 siblings, 0 replies; 6+ messages in thread
From: Michal Marek @ 2011-09-09 9:46 UTC (permalink / raw)
To: Peter Foley
Cc: Arnaud Lacombe, Linux Kernel Mailing List,
Linux Kbuild Mailing List, rdunlap
On 1.8.2011 15:51, Peter Foley wrote:
> The introduction of include/linux/kconfig.h created 3 extraneous
> dependencies:
> include/config/.h
> include/config/h.h
> include/config/foo.h
>
> Fix this by excluding kconfig.h from fixdep calculations.
>
> Signed-off-by: Peter Foley <pefoley2@verizon.net>
Applied to kbuild-2.6.git#kbuild.
Michal
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-09-09 9:46 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-01 0:36 [PATCH RFC] kconfig.h fix extraneous dependencies Peter Foley
2011-08-01 0:53 ` Arnaud Lacombe
2011-08-01 1:16 ` Peter Foley
2011-08-01 9:24 ` Michal Marek
2011-08-01 13:51 ` [PATCH v2] " Peter Foley
2011-09-09 9:46 ` Michal Marek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).