Skip to contentSkip to conversation

Remove suggestion that Kconfig files can use "requires" to list deps

PATCH New Robert P. J. Day 3 participants 8 messages Dec 18, 2006 – Jan 1, 2007

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Remove suggestion that Kconfig files can use "requires" to list deps

Remove the note in the documentation that suggests people can use
"requires" for dependencies in Kconfig files.

---

at this point, AFAICT, all Kconfig files now use "depends on"
exclusively, except for three that still use "depends", but i've already submitted a patch for that that should be in the pipeline somewhere.

Documentation/kbuild/kconfig-language.txt +1 -1
index 536d5bf..658abb5 100644
@@ -77,7 +77,7 @@ applicable everywhere (see syntax).
   Optionally, dependencies only for this default value can be added with
   "if".
 
-- dependencies: "depends on"/"requires" <expr>
+- dependencies: "depends on" <expr>
   This defines a dependency for this menu entry. If multiple
   dependencies are defined, they are connected with '&&'. Dependencies
   are applied to all other options within this menu entry (which also
#1 lore raw

PATCH 1/1 kconfig: remove the unused "requires" syntax

Quoted 4 lines · Robert P. J. Day

Remove the note in the documentation that suggests people can use
"requires" for dependencies in Kconfig files.
...

Considering that noone uses it, what about the patch below to also remove the implementation?

cu
Adrian

<-- snip -->

This patch removes the "requires" from the Kconfig language that was an unused alternative to "depends on".

The size of this patch comes from the generated files that are changed.

---

 Documentation/kbuild/kconfig-language.txt |    2 
 scripts/kconfig/lex.zconf.c_shipped       |    4 
 scripts/kconfig/zconf.gperf               |    1 
 scripts/kconfig/zconf.hash.c_shipped      |   10 
 scripts/kconfig/zconf.tab.c_shipped       | 1397 ++++++++++++----------
 scripts/kconfig/zconf.y                   |    6 
 6 files changed, 777 insertions(+), 643 deletions(-)
Documentation/kbuild/kconfig-language.txt +1 -1
index 536d5bf..658abb5 100644
@@ -77,7 +77,7 @@ applicable everywhere (see syntax).
   Optionally, dependencies only for this default value can be added with
   "if".
 
-- dependencies: "depends on"/"requires" <expr>
+- dependencies: "depends on" <expr>
   This defines a dependency for this menu entry. If multiple
   dependencies are defined, they are connected with '&&'. Dependencies
   are applied to all other options within this menu entry (which also
scripts/kconfig/lex.zconf.c_shipped +2 -2
index 800f8c7..05c37f0 100644
@@ -33,7 +33,7 @@
 #if __STDC_VERSION__ >= 199901L
 
 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
- * if you want the limit (max/min) macros for int types.
+ * if you want the limit (max/min) macros for int types. 
  */
 #ifndef __STDC_LIMIT_MACROS
 #define __STDC_LIMIT_MACROS 1
@@ -1511,7 +1511,7 @@ static int yy_get_next_buffer (void)
 
 		/* Read in more data. */
 		YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
-			(yy_n_chars), num_to_read );
+			(yy_n_chars), (size_t) num_to_read );
 
 		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
 		}
scripts/kconfig/zconf.gperf +0 -1
index 9b44c80..a6a2740 100644
@@ -23,7 +23,6 @@ help,		T_HELP,		TF_COMMAND
 if,		T_IF,		TF_COMMAND|TF_PARAM
 endif,		T_ENDIF,	TF_COMMAND
 depends,	T_DEPENDS,	TF_COMMAND
-requires,	T_REQUIRES,	TF_COMMAND
 optional,	T_OPTIONAL,	TF_COMMAND
 default,	T_DEFAULT,	TF_COMMAND, S_UNKNOWN
 prompt,		T_PROMPT,	TF_COMMAND
scripts/kconfig/zconf.hash.c_shipped +4 -6
index 47c8b5b..a707c53 100644
@@ -1,4 +1,4 @@
-/* ANSI-C code produced by gperf version 3.0.1 */
+/* ANSI-C code produced by gperf version 3.0.2 */
 /* Command-line: gperf  */
 /* Computed positions: -k'1,3' */
 
@@ -55,7 +55,7 @@ kconf_id_hash (register const char *str, register unsigned int len)
       47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
       47, 47, 47, 47, 47, 47, 47, 25, 30, 15,
        0, 15,  0, 47,  5, 15, 47, 47, 30, 20,
-       5,  0, 25, 15,  0,  0, 10, 35, 47, 47,
+       5,  0, 25, 47,  0,  0, 10, 35, 47, 47,
        5, 47, 47, 47, 47, 47, 47, 47, 47, 47,
       47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
       47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
@@ -103,7 +103,6 @@ struct kconf_id_strings_t
     char kconf_id_strings_str20[sizeof("endif")];
     char kconf_id_strings_str21[sizeof("choice")];
     char kconf_id_strings_str22[sizeof("endmenu")];
-    char kconf_id_strings_str23[sizeof("requires")];
     char kconf_id_strings_str24[sizeof("endchoice")];
     char kconf_id_strings_str26[sizeof("config")];
     char kconf_id_strings_str27[sizeof("modules")];
@@ -139,7 +138,6 @@ static struct kconf_id_strings_t kconf_id_strings_contents =
     "endif",
     "choice",
     "endmenu",
-    "requires",
     "endchoice",
     "config",
     "modules",
@@ -167,7 +165,7 @@ kconf_id_lookup (register const char *str, register unsigned int len)
 {
   enum
     {
-      TOTAL_KEYWORDS = 33,
+      TOTAL_KEYWORDS = 32,
       MIN_WORD_LENGTH = 2,
       MAX_WORD_LENGTH = 14,
       MIN_HASH_VALUE = 2,
@@ -196,7 +194,7 @@ kconf_id_lookup (register const char *str, register unsigned int len)
       {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str20,		T_ENDIF,	TF_COMMAND},
       {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str21,		T_CHOICE,	TF_COMMAND},
       {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str22,	T_ENDMENU,	TF_COMMAND},
-      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str23,	T_REQUIRES,	TF_COMMAND},
+      {-1},
       {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str24,	T_ENDCHOICE,	TF_COMMAND},
       {-1},
       {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str26,		T_CONFIG,	TF_COMMAND},
scripts/kconfig/zconf.tab.c_shipped +770 -627

2,172 lines not on this page · raw message

scripts/kconfig/zconf.y +0 -6
index 04a5864..7387387 100644
@@ -64,7 +64,6 @@ static struct menu *current_menu, *current_entry;
 %token <id>T_IF
 %token <id>T_ENDIF
 %token <id>T_DEPENDS
-%token <id>T_REQUIRES
 %token <id>T_OPTIONAL
 %token <id>T_PROMPT
 %token <id>T_TYPE
@@ -423,11 +422,6 @@ depends: T_DEPENDS T_ON expr T_EOL
 {
 	menu_add_dep($2);
 	printd(DEBUG_PARSE, "%s:%d:depends\n", zconf_curname(), zconf_lineno());
-}
-	| T_REQUIRES expr T_EOL
-{
-	menu_add_dep($2);
-	printd(DEBUG_PARSE, "%s:%d:requires\n", zconf_curname(), zconf_lineno());
 };
 
 /* prompt statement */
#2 lore raw

Re: [2.6 patch] kconfig: remove the unused "requires" syntax

Quoted 8 lines · Adrian Bunk
Quoted 4 lines · Robert P. J. Day

Remove the note in the documentation that suggests people can use
"requires" for dependencies in Kconfig files.
...

Considering that noone uses it, what about the patch below to also remove the implementation?

... big snip ...

i have no problem knocking out of the parser anything related to "depends" or "requires." in fact, i did note in earlier patch submissions that i was just cleaning the Kconfig files but i was leaving the parser alone, and someone else was welcome to take care of that.

if the kbuild folks are good with this, i certainly have no objection.

rday

p.s. i didn't look closely enough to see if your patch took out support for both "depends" *and* "requires". at this point, neither of those are necessary anymore -- it's all "depends on" except for three remaining Kconfig files.

#3 lore raw

Re: [2.6 patch] kconfig: remove the unused "requires" syntax

Quoted 19 lines · Robert P. J. Day
Quoted 8 lines · Adrian Bunk
Quoted 4 lines · Robert P. J. Day

Remove the note in the documentation that suggests people can use
"requires" for dependencies in Kconfig files.
...

Considering that noone uses it, what about the patch below to also remove the implementation?

... big snip ...

i have no problem knocking out of the parser anything related to "depends" or "requires." in fact, i did note in earlier patch submissions that i was just cleaning the Kconfig files but i was leaving the parser alone, and someone else was welcome to take care of that.

Quoted 8 lines

if the kbuild folks are good with this, i certainly have no objection.

rday

p.s. i didn't look closely enough to see if your patch took out support for both "depends" *and* "requires". at this point, neither of those are necessary anymore -- it's all "depends on" except for three remaining Kconfig files.

It takes out only "requires" (as the patch description says).

Whether to remove the plain "depends" (opposed to "depends on") is a different (and perhaps more controversial) question, but it should anyway not happen before the last usage is removed.

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#4 lore raw

Re: [2.6 patch] kconfig: remove the unused "requires" syntax

Quoted 8 lines · Adrian Bunk
Quoted 4 lines · Robert P. J. Day

p.s. i didn't look closely enough to see if your patch took out support for both "depends" *and* "requires". at this point, neither of those are necessary anymore -- it's all "depends on" except for three remaining Kconfig files.

It takes out only "requires" (as the patch description says).

which makes perfect sense, of course.

Quoted 3 lines

Whether to remove the plain "depends" (opposed to "depends on") is a different (and perhaps more controversial) question, but it should anyway not happen before the last usage is removed.

agreed on that last point. my patch submission to change "depends" to "depends on" globally *did* get applied recently:

commit 775ba7ad491a154f99871fe603f03366e84ae159
Merge: d940505... 18b36c7...
Author: Linus Torvalds <[email protected]>
Date: Tue Dec 12 18:51:51 2006 -0800

    Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial

    * git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial:
      ...
      kconfig: Standardize "depends" -> "depends on" in Kconfig files
      ...

so it's clear that that transformation was approved. now we just wait for the patch to deal with the last three files to go through and we're all set.

$ grep "depends" $(find . -name Kconfig) | grep -v "depends on"
./arch/arm/mm/Kconfig:  depends !MMU && CPU_CP15 && !CPU_ARM740T
./arch/arm/Kconfig:     depends CPU_XSCALE || CPU_XSC3
./arch/v850/Kconfig:      depends !V850E2_SIM85E2C

rday

#5 lore raw

Re: [2.6 patch] kconfig: remove the unused "requires" syntax

In reply to Adrian Bunk

Hi,

Quoted 8 lines · Adrian Bunk
Quoted 4 lines · Robert P. J. Day

Remove the note in the documentation that suggests people can use
"requires" for dependencies in Kconfig files.
...

Considering that noone uses it, what about the patch below to also remove the implementation?

Mostly to keep the noise in the generated files low I prefer to just add some warning prints and I'll remove them later with some other syntax changes. This would also give external trees the chance to fix any possible usage first.

bye, Roman

#6 lore raw

Re: [2.6 patch] kconfig: remove the unused "requires" syntax

Quoted 10 lines · Roman Zippel

Hi,

Quoted 6 lines · Adrian Bunk
Quoted 4 lines · Robert P. J. Day

Remove the note in the documentation that suggests people can use
"requires" for dependencies in Kconfig files.
...

Quoted 7 lines
Quoted 2 lines

Considering that noone uses it, what about the patch below to also remove the implementation?

Mostly to keep the noise in the generated files low I prefer to just add some warning prints and I'll remove them later with some other syntax changes. This would also give external trees the chance to fix any possible usage first.

How to add some warning prints?

And what's the problem with changing the generated files? There doesn't seem to be much activity in this area, and the noise of changing the generated files doesn't seem to be a problem for me (except if anyone else is semnding patches for the same area at the same time. It's not as if this noise was big compared to the diff between two Linux releases...

Regarding external trees:
Do you know about anyone actually using it?
The fact that we have zero usages in the kernel and that it doesn't have any additional functionality seems to be a strong hint noone knows about it. And if anyone really uses it, the fix is so trivial...

Quoted 1 line

bye, Roman

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#7 lore raw

Re: [2.6 patch] kconfig: remove the unused "requires" syntax

Hi,

Quoted 1 line · Adrian Bunk

How to add some warning prints?

Simple, see the attached patch.

Quoted 6 lines

And what's the problem with changing the generated files? There doesn't seem to be much activity in this area, and the noise of changing the generated files doesn't seem to be a problem for me (except if anyone else is semnding patches for the same area at the same time. It's not as if this noise was big compared to the diff between two Linux releases...

The additional syntax doesn't hurt anyone, thus I prefer the simpler change.

Quoted 2 lines

Regarding external trees:
Do you know about anyone actually using it?

No and that's not the point, there is simply no need to change the syntax this drastically. Just printing a warning is sufficient, which actually tells the user more specifically what to change, instead of an anonymous syntax error.

bye, Roman

---
 scripts/kconfig/zconf.tab.c_shipped |    2 ++
 scripts/kconfig/zconf.y             |    2 ++
 2 files changed, 4 insertions(+)
scripts/kconfig/zconf.tab.c_shipped +2 -0
Index: linux-2.6/scripts/kconfig/zconf.tab.c_shipped
===================================================================
@@ -1738,6 +1738,7 @@ yyreduce:
 
     {
 	menu_add_dep((yyvsp[-1].expr));
+	zconfprint("warning: 'depends' used without 'on' keyword");
 	printd(DEBUG_PARSE, "%s:%d:depends\n", zconf_curname(), zconf_lineno());
 ;}
     break;
@@ -1746,6 +1747,7 @@ yyreduce:
 
     {
 	menu_add_dep((yyvsp[-1].expr));
+	zconfprint("warning: 'requires' keyword is deprecated");
 	printd(DEBUG_PARSE, "%s:%d:requires\n", zconf_curname(), zconf_lineno());
 ;}
     break;
scripts/kconfig/zconf.y +2 -0
Index: linux-2.6/scripts/kconfig/zconf.y
===================================================================
@@ -422,11 +422,13 @@ depends: T_DEPENDS T_ON expr T_EOL
 	| T_DEPENDS expr T_EOL
 {
 	menu_add_dep($2);
+	zconfprint("warning: 'depends' used without 'on' keyword");
 	printd(DEBUG_PARSE, "%s:%d:depends\n", zconf_curname(), zconf_lineno());
 }
 	| T_REQUIRES expr T_EOL
 {
 	menu_add_dep($2);
+	zconfprint("warning: 'requires' keyword is deprecated");
 	printd(DEBUG_PARSE, "%s:%d:requires\n", zconf_curname(), zconf_lineno());
 };