From patchwork Thu Mar 22 17:00:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 10301905 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 D6BD8600F6 for ; Thu, 22 Mar 2018 17:01:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CB8C328686 for ; Thu, 22 Mar 2018 17:01:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C07A7287F2; Thu, 22 Mar 2018 17:01:17 +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 2E15328800 for ; Thu, 22 Mar 2018 17:01:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751901AbeCVRBQ (ORCPT ); Thu, 22 Mar 2018 13:01:16 -0400 Received: from conuserg-09.nifty.com ([210.131.2.76]:47772 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751898AbeCVRBQ (ORCPT ); Thu, 22 Mar 2018 13:01:16 -0400 Received: from grover.sesame (FL1-125-199-20-195.osk.mesh.ad.jp [125.199.20.195]) (authenticated) by conuserg-09.nifty.com with ESMTP id w2MH0Mr2012430; Fri, 23 Mar 2018 02:00:22 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com w2MH0Mr2012430 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1521738023; bh=6o5EADB16+/r+2A3psEaEYkm6g5BiCsyGcgmSzNLIC8=; h=From:To:Cc:Subject:Date:From; b=To7dO+eM5igdFZv1Lt53HpwLO3xBf6Nse4kltYV8nLzT/msAs1QPtDWSdEzCQlNGa EQ3GZYZABUb4CHlnegPUXkSXpWn7A6H+9ZY8cwmBJd2Nb337dpQx4ugUcFkoIwmopU Oxe5G/7PBVZO3y2qUSrhIeRr9gcfNhxSft24zHqxnwwcFxtp/20F/+B6folUu6o7pf 1IBtlf0wFyYsMoYZb3g8fP7bGWPz1Bc7eqa4/H+eY76Mdvw1SlkRBUX4MgCISIdqXq TXyYCjPIHRSasmlT39E+f+xo82/5vpTOKNUis0MGwR5hInLkHYdFZtnALdJIK1G36E eRSOG7yi338ug== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Michal Marek , Sam Ravnborg , Ulf Magnusson , "Luis R . Rodriguez" , Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH 1/3] kconfig: remove duplicated file name and lineno of recursive inclusion Date: Fri, 23 Mar 2018 02:00:12 +0900 Message-Id: <1521738014-18895-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 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 As in the unit test, the error message for the recursive inclusion looks like this: Kconfig.inc1:4: recursive inclusion detected. Inclusion path: current file : 'Kconfig.inc1' included from: 'Kconfig.inc3:1' included from: 'Kconfig.inc2:3' included from: 'Kconfig.inc1:4' The 'Kconfig.inc1:4' is duplicated in the first and last lines. Also, the single quotes do not help readability. Change the message like follows: Recursive inclusion detected. Inclusion path: current file : Kconfig.inc1 included from: Kconfig.inc3:1 included from: Kconfig.inc2:3 included from: Kconfig.inc1:4 Signed-off-by: Masahiro Yamada --- scripts/kconfig/tests/err_recursive_inc/expected_stderr | 11 ++++++----- scripts/kconfig/zconf.l | 9 ++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/scripts/kconfig/tests/err_recursive_inc/expected_stderr b/scripts/kconfig/tests/err_recursive_inc/expected_stderr index a15dbed..6b582ee 100644 --- a/scripts/kconfig/tests/err_recursive_inc/expected_stderr +++ b/scripts/kconfig/tests/err_recursive_inc/expected_stderr @@ -1,5 +1,6 @@ -Kconfig.inc1:4: recursive inclusion detected. Inclusion path: - current file : 'Kconfig.inc1' - included from: 'Kconfig.inc3:1' - included from: 'Kconfig.inc2:3' - included from: 'Kconfig.inc1:4' +Recursive inclusion detected. +Inclusion path: + current file : Kconfig.inc1 + included from: Kconfig.inc3:1 + included from: Kconfig.inc2:3 + included from: Kconfig.inc1:4 diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l index 88b650e..6f139d2 100644 --- a/scripts/kconfig/zconf.l +++ b/scripts/kconfig/zconf.l @@ -328,14 +328,13 @@ void zconf_nextfile(const char *name) for (iter = current_file->parent; iter; iter = iter->parent ) { if (!strcmp(current_file->name,iter->name) ) { fprintf(stderr, - "%s:%d: recursive inclusion detected. " - "Inclusion path:\n current file : '%s'\n", - zconf_curname(), zconf_lineno(), - zconf_curname()); + "Recursive inclusion detected.\n" + "Inclusion path:\n" + " current file : %s\n", zconf_curname()); iter = current_file; do { iter = iter->parent; - fprintf(stderr, " included from: '%s:%d'\n", + fprintf(stderr, " included from: %s:%d\n", iter->name, iter->lineno - 1); } while (strcmp(iter->name, current_file->name)); exit(1);