diff mbox

kconfig/nconf: remove useless conditionnal

Message ID 1310282853-14550-1-git-send-email-lacombar@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Arnaud Lacombe July 10, 2011, 7:27 a.m. UTC
After the test

	if (!submenu || ...)
		continue;

the variable `submenu' can _not_ be NULL, so do not test for this situation.

Cc: Nir Tzachar <nir.tzachar@gmail.com>
Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
---
 scripts/kconfig/nconf.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

Comments

Arnaud Lacombe July 18, 2011, 6:11 p.m. UTC | #1
Hi,

On Sun, Jul 10, 2011 at 3:27 AM, Arnaud Lacombe <lacombar@gmail.com> wrote:
> After the test
>
>        if (!submenu || ...)
>                continue;
>
> the variable `submenu' can _not_ be NULL, so do not test for this situation.
>
> Cc: Nir Tzachar <nir.tzachar@gmail.com>
> Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
> ---
>  scripts/kconfig/nconf.c |    5 +----
>  1 files changed, 1 insertions(+), 4 deletions(-)
>
> diff --git a/scripts/kconfig/nconf.c b/scripts/kconfig/nconf.c
> index eb9e49d..6b189c8 100644
> --- a/scripts/kconfig/nconf.c
> +++ b/scripts/kconfig/nconf.c
> @@ -1155,10 +1155,7 @@ static void conf(struct menu *menu)
>                active_menu = (struct menu *)item_data();
>                if (!submenu || !menu_is_visible(submenu))
>                        continue;
> -               if (submenu)
> -                       sym = submenu->sym;
> -               else
> -                       sym = NULL;
> +               sym = submenu->sym;
>
>                switch (res) {
>                case ' ':
Michal, ping ?

 - Arnaud

> --
> 1.7.3.4.574.g608b.dirty
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Cong Wang July 21, 2011, 5:08 a.m. UTC | #2
On Tue, Jul 19, 2011 at 2:11 AM, Arnaud Lacombe <lacombar@gmail.com> wrote:
> Hi,
>
> On Sun, Jul 10, 2011 at 3:27 AM, Arnaud Lacombe <lacombar@gmail.com> wrote:
>> After the test
>>
>>        if (!submenu || ...)
>>                continue;
>>
>> the variable `submenu' can _not_ be NULL, so do not test for this situation.
>>

Yeah, looks good.
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/scripts/kconfig/nconf.c b/scripts/kconfig/nconf.c
index eb9e49d..6b189c8 100644
--- a/scripts/kconfig/nconf.c
+++ b/scripts/kconfig/nconf.c
@@ -1155,10 +1155,7 @@  static void conf(struct menu *menu)
 		active_menu = (struct menu *)item_data();
 		if (!submenu || !menu_is_visible(submenu))
 			continue;
-		if (submenu)
-			sym = submenu->sym;
-		else
-			sym = NULL;
+		sym = submenu->sym;
 
 		switch (res) {
 		case ' ':