Skip to contentSkip to conversation

kconfig: do not overwrite symbol direct dependency in assignment

PATCH In review Arnaud Lacombe 2 participants 5 messages May 25, 2011 – Jun 24, 2011

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

PATCH 1/1 kconfig: do not overwrite symbol direct dependency in assignment

Considering the following configuration:

config F
bool "F"

choice AB
bool "AB"
config A
bool "A"
config B
bool "B"
endchoice

if A
config D
bool
default y if F
select E
config E
bool "E"
endif

if B
config D
bool
default y if F
select E
config E
bool "E"
endif

The following configuration:

CONFIG_F=y
CONFIG_A=y
CONFIG_D=y
CONFIG_E=y

emits a spurious warning:

(D) selects E which has unmet direct dependencies (B)

If a symbol appears in two different branch of the tree, it should inherit the dependency of both parent, not just the last one.

---
 scripts/kconfig/menu.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
scripts/kconfig/menu.c +1 -1
index 5fdf10d..d0c65e7 100644
@@ -350,7 +350,7 @@ void menu_finalize(struct menu *parent)
 			last_menu->next = NULL;
 		}
 
-		sym->dir_dep.expr = parent->dep;
+		sym->dir_dep.expr = expr_alloc_or(sym->dir_dep.expr, parent->dep);
 	}
 	for (menu = parent->list; menu; menu = menu->next) {
 		if (sym && sym_is_choice(sym) &&
Signature · 1 line
1.7.3.4.574.g608b.dirty
#1 lore raw

Hi,

Quoted 31 lines · Arnaud Lacombe

Considering the following configuration:

config F
   bool "F"

choice AB
   bool "AB"
config A
   bool "A"
config B
   bool "B"
endchoice

if A
config D
   bool
   default y if F
   select E
config E
   bool "E"
endif

if B
config D
   bool
   default y if F
   select E
config E
   bool "E"
endif

Quoted 7 lines

The following configuration:

CONFIG_F=y
CONFIG_A=y
CONFIG_D=y
CONFIG_E=y

d'oh! this should have read:

CONFIG_F=y
CONFIG_A=y
# CONFIG_B is not set
CONFIG_D=y
CONFIG_E=y

but I missed the leading space, and git decided to eat the assignment of CONFIG_B.

sorry about that,
- Arnaud

#2 lore raw
In reply to Arnaud Lacombe

Hi,

Quoted 45 lines · Arnaud Lacombe

Considering the following configuration:

config F
   bool "F"

choice AB
   bool "AB"
config A
   bool "A"
config B
   bool "B"
endchoice

if A
config D
   bool
   default y if F
   select E
config E
   bool "E"
endif

if B
config D
   bool
   default y if F
   select E
config E
   bool "E"
endif

The following configuration:

CONFIG_F=y
CONFIG_A=y
CONFIG_D=y
CONFIG_E=y

emits a spurious warning:

(D) selects E which has unmet direct dependencies (B)

If a symbol appears in two different branch of the tree, it should inherit the dependency of both parent, not just the last one.

Quoted 7 lines

---
 scripts/kconfig/menu.c |    2 +-

 1 files changed, 1 insertions(+), 1 deletions(-)

ping ?

Quoted 17 lines
scripts/kconfig/menu.c +1 -1
index 5fdf10d..d0c65e7 100644
@@ -350,7 +350,7 @@ void menu_finalize(struct menu *parent)
                        last_menu->next = NULL;
                }
 
-               sym->dir_dep.expr = parent->dep;
+               sym->dir_dep.expr = expr_alloc_or(sym->dir_dep.expr, parent->dep);
        }
        for (menu = parent->list; menu; menu = menu->next) {

               if (sym && sym_is_choice(sym) &&
--
1.7.3.4.574.g608b.dirty

#3 lore raw

PATCH 1/1 kconfig: do not overwrite symbol direct dependency in assignment

In reply to Arnaud Lacombe

Hi Michal,

Re-sent, mostly to have the commit log right.

Regards,
- Arnaud

---
From: Arnaud Lacombe <[email protected]>

Considering the following configuration:

config F
bool "F"

choice AB
bool "AB"
config A
bool "A"
config B
bool "B"
endchoice

if A
config D
bool
default y if F
select E
config E
bool "E"
endif

if B
config D
bool
default y if F
select E
config E
bool "E"
endif

The following configuration:

CONFIG_F=y
CONFIG_A=y
# CONFIG_B is not set
CONFIG_D=y
CONFIG_E=y

emits a spurious warning:

(D) selects E which has unmet direct dependencies (B)

If a symbol appears in two different branch of the tree, it should inherit the dependency of both parent, not just the last one.

---
 scripts/kconfig/menu.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
scripts/kconfig/menu.c +1 -1
index 5fdf10d..d0c65e7 100644
@@ -350,7 +350,7 @@ void menu_finalize(struct menu *parent)
 			last_menu->next = NULL;
 		}
 
-		sym->dir_dep.expr = parent->dep;
+		sym->dir_dep.expr = expr_alloc_or(sym->dir_dep.expr, parent->dep);
 	}
 	for (menu = parent->list; menu; menu = menu->next) {
 		if (sym && sym_is_choice(sym) &&
Signature · 1 line
1.7.3.4.574.g608b.dirty
#4 lore raw
Quoted 11 lines · Arnaud Lacombe

Hi Michal,

Re-sent, mostly to have the commit log right.

Regards,
- Arnaud

---
From: Arnaud Lacombe <[email protected]>

Considering the following configuration:

Applied to kbuild-2.6.git#kconfig, thanks.

Michal