From patchwork Fri Dec 15 15:28:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 10115371 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 953946019C for ; Fri, 15 Dec 2017 15:30:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7E22529F66 for ; Fri, 15 Dec 2017 15:30:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7146A29F69; Fri, 15 Dec 2017 15:30:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 80BF429F66 for ; Fri, 15 Dec 2017 15:30:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932302AbdLOPay (ORCPT ); Fri, 15 Dec 2017 10:30:54 -0500 Received: from conuserg-10.nifty.com ([210.131.2.77]:62822 "EHLO conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932072AbdLOPax (ORCPT ); Fri, 15 Dec 2017 10:30:53 -0500 Received: from grover.sesame (FL1-125-199-20-195.osk.mesh.ad.jp [125.199.20.195]) (authenticated) by conuserg-10.nifty.com with ESMTP id vBFFSwPZ017017; Sat, 16 Dec 2017 00:28:58 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com vBFFSwPZ017017 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1513351739; bh=vS5x2xHYXO5TRze9omuv8++OAtRfR7om1Cvaaou188c=; h=From:To:Cc:Subject:Date:From; b=YzopaFmqPpgvLOMpeHDCOyiMAMXQtm487IYda7ODloRr2KkVcC+Prma8cLrh+kscB 1Jws3H1CuEQGbwuCFTSatxMdzS4tAWXn08djke4urw+Y6P6YgU5Sui7DAAFBJasFbI r+bAzzjTS2Ua01bnr0NrkDd6fTaSNXZknqZilHDyx+FlU9Z2eo4lhvpweRoENwTOcO JD3lw42fJj9vfepzaCr6lVt8dDQ4CWH/oOxOBMNnQt6RTfavkM7hpuqsupxvUEuL0N Anzny0yFg5ysBlx9JplYkWwRmzcZAiLxEFItJ0ay1TCTvDTEdOavqkYg0WxZIUWUI+ bXTuq2OLOgIoQ== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Nicolas Pitre , "Luis R . Rodriguez" , Randy Dunlap , Michal Marek , Sam Ravnborg , Ulf Magnusson , Masahiro Yamada , Heinrich Schuchardt , linux-kernel@vger.kernel.org Subject: [PATCH] kconfig: display recursive dependency resolution hint just once Date: Sat, 16 Dec 2017 00:28:42 +0900 Message-Id: <1513351722-14196-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Commit 1c199f2878f6 ("kbuild: document recursive dependency limitation / resolution") probably intended to show a hint along with "recursive dependency detected!" error, but it missed to add {...} guard, and the hint is displayed in every loop of the dep_stack traverse, annoyingly. This error was detected by GCC's -Wmisleading-indentation when switching to build-time generation of lexer/parser. scripts/kconfig/symbol.c: In function ‘sym_check_print_recursive’: scripts/kconfig/symbol.c:1150:3: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] if (stack->sym == last_sym) ^~ scripts/kconfig/symbol.c:1153:4: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ fprintf(stderr, "For a resolution refer to Documentation/kbuild/kconfig-language.txt\n"); ^~~~~~~ I could simply add {...} to surround the three fprintf(), but I rather chose to move the hint after the loop to make the whole message readable. Fixes: 1c199f2878f6 ("kbuild: document recursive dependency limitation / resolution" Signed-off-by: Masahiro Yamada Acked-by: Luis R. Rodriguez --- scripts/kconfig/symbol.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c index 3c8bd9b..35e0937 100644 --- a/scripts/kconfig/symbol.c +++ b/scripts/kconfig/symbol.c @@ -1150,8 +1150,7 @@ static void sym_check_print_recursive(struct symbol *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, @@ -1181,6 +1180,11 @@ static void sym_check_print_recursive(struct symbol *last_sym) } } + fprintf(stderr, + "For a resolution refer to Documentation/kbuild/kconfig-language.txt\n" + "subsection \"Kconfig recursive dependency limitations\"\n" + "\n"); + if (check_top == &cv_stack) dep_stack_remove(); }