diff mbox

kconfig: Add some missing curly braces

Message ID 20160713223433.GA20475@mwanda (mailing list archive)
State New, archived
Headers show

Commit Message

Dan Carpenter July 13, 2016, 10:34 p.m. UTC
There are missing curly braces here so we print some stuff to stderr
which we hadn't intended.

Fixes: 1c199f2878f6 ('kbuild: document recursive dependency limitation / resolution')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

--
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

Comments

Luis Chamberlain July 14, 2016, 2:10 a.m. UTC | #1
On Thu, Jul 14, 2016 at 01:34:33AM +0300, Dan Carpenter wrote:
> There are missing curly braces here so we print some stuff to stderr
> which we hadn't intended.
> 
> Fixes: 1c199f2878f6 ('kbuild: document recursive dependency limitation / resolution')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Acked-by: Luis R. Rodriguez <mcgrof@kernel.org>

  Luis
--
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
Masahiro Yamada July 16, 2016, 3:27 p.m. UTC | #2
2016-07-14 7:34 GMT+09:00 Dan Carpenter <dan.carpenter@oracle.com>:
> There are missing curly braces here so we print some stuff to stderr
> which we hadn't intended.
>
> Fixes: 1c199f2878f6 ('kbuild: document recursive dependency limitation / resolution')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
> index 2432298..ff0feab 100644
> --- a/scripts/kconfig/symbol.c
> +++ b/scripts/kconfig/symbol.c
> @@ -1127,11 +1127,12 @@ static void sym_check_print_recursive(struct symbol *last_sym)
>                                         break;
>                         }
>                 }
> -               if (stack->sym == last_sym)
> +               if (stack->sym == last_sym) {
>                         fprintf(stderr, "%s:%d:error: recursive dependency detected!\n",
>                                 prop->file->name, prop->lineno);
>                         fprintf(stderr, "For a resolution refer to Documentation/kbuild/kconfig-language.txt\n");
>                         fprintf(stderr, "subsection \"Kconfig recursive dependency limitations\"\n");
> +               }
>                 if (stack->expr) {
>                         fprintf(stderr, "%s:%d:\tsymbol %s %s value contains %s\n",
>                                 prop->file->name, prop->lineno,



Good catch!


BTW, another solution is to concatenate three messages into one.

if (stack->sym == last_sym)
         fprintf(stderr,
                 "%s:%d:error: recursive dependency detected!\n"
                 "For a resolution refer to
Documentation/kbuild/kconfig-language.txt\n"
                 "subsection \"Kconfig recursive dependency limitations\"\n",
                 prop->file->name, prop->lineno);


Personally, I prefer this.
It may be a matter of taste, though.
diff mbox

Patch

diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
index 2432298..ff0feab 100644
--- a/scripts/kconfig/symbol.c
+++ b/scripts/kconfig/symbol.c
@@ -1127,11 +1127,12 @@  static void sym_check_print_recursive(struct symbol *last_sym)
 					break;
 			}
 		}
-		if (stack->sym == last_sym)
+		if (stack->sym == last_sym) {
 			fprintf(stderr, "%s:%d:error: recursive dependency detected!\n",
 				prop->file->name, prop->lineno);
 			fprintf(stderr, "For a resolution refer to Documentation/kbuild/kconfig-language.txt\n");
 			fprintf(stderr, "subsection \"Kconfig recursive dependency limitations\"\n");
+		}
 		if (stack->expr) {
 			fprintf(stderr, "%s:%d:\tsymbol %s %s value contains %s\n",
 				prop->file->name, prop->lineno,