Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3260411imm; Fri, 20 Jul 2018 13:04:26 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdz0ngOluJH4M6kxbuU+lfdoOcPgySM8iwtOhph4YjiDuDQTNTQMcEiFZDxkOTb785dghra X-Received: by 2002:a17:902:b717:: with SMTP id d23-v6mr3361136pls.105.1532117066010; Fri, 20 Jul 2018 13:04:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532117065; cv=none; d=google.com; s=arc-20160816; b=J0eHyNT3OFoMHHr7KkPBTCdZ+RRh9QhLvn8OMKWBO8jSGhtgbUJdWzdMHeq3DG0he9 +gIAc/W3vlHpL45DS1DvpbZjH1U0SdvrfEtKbFJILdOVGOUMnMwvvtAgRS/V1Au2UOnh K1BwTJ0n6XbKtBQfl5CH8WtwsRzjPuszQA+OwgN9HUSluWK8B3oKSgWnrUbUlxrPHP00 dhItPcdVqhwcmKb0bjfId5eKQce7tQ4+wpaxCrC5ofvP2ttALtpRX1+CquTdVEyvgHFG pUi3fbzFb9O4ruAmOAXv7HIxiBEo7kUbBeMxcFPLLWJ2uu0NwnOGdARKAnXtI4GGhZld Vdnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:user-agent :references:in-reply-to:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=WW77KF32v/9YZjhkLMnQUVJC/2sSdjbT80F6lvGfc70=; b=jEeeA+wpqZ+fsSSBNTdfd9ckI7D1gE7PdEauRxlYRSayT/8LOcLjmNlK1uVFGVy4/3 VQznKC1/0kE3c7wtpxCpx7eUJQSkSc10S58lIxGjDkxjGvISFtczoBLnYRL6xtj+0g49 UnyrhlL5JDZ3upp+KokaDbSQmHpq6tRkmQamZCMjssRpl/SZsKqwmh0KoQmq28jdaOD6 /kABvdsQHn4sjq/P1bBaKzEBYhFejP8y+g0pT541FXJScDWprz3pZOuRPmUMBfPFVd/q eZzGNrQ5uFn8Madp/yOsvmDPZHf3jZvB8fPc/c/EPjg3jdH7EESzm2pvtu1trbrrXEjs vlbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gouders.net header.s=gnet header.b=M6hyYpbk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c32-v6si2550425pgc.129.2018.07.20.13.04.11; Fri, 20 Jul 2018 13:04:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gouders.net header.s=gnet header.b=M6hyYpbk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728161AbeGTUwp (ORCPT + 99 others); Fri, 20 Jul 2018 16:52:45 -0400 Received: from services.gouders.net ([141.101.32.176]:39509 "EHLO services.gouders.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727762AbeGTUwp (ORCPT ); Fri, 20 Jul 2018 16:52:45 -0400 Received: from localhost (ltea-047-066-036-141.pools.arcor-ip.net [47.66.36.141]) (authenticated bits=0) by services.gouders.net (8.14.8/8.14.8) with ESMTP id w6KJvYpn012324 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 20 Jul 2018 21:57:35 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gouders.net; s=gnet; t=1532116655; bh=XnG6fMeuH0WpeglFBaQF2+1Yh+4SwSfFuO4ngDNlleQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=M6hyYpbkSVhqN9C4Ue41Mzwh7Ay82POXUSdR2PXOp5CON7ldIxXIdan3cn/dFradY HNIzBIqw7eoo3//toLCCbBkOHAbfYV+PueEiL8RkzcqK/VJGNhsBXRWN1tPQTOcOUd +I8u7HEaZWIrdOhWIxPW7pmpNqT5aIF+3ZygGCTc= From: Dirk Gouders To: Christoph Hellwig Cc: Randy Dunlap , Masahiro Yamada , Richard Weinberger , Linux Kbuild mailing list , linux-um@lists.infradead.org, Linux Kernel Mailing List Subject: Re: [PATCH 4/9] kconfig: include common Kconfig files from top-level Kconfig In-Reply-To: <20180719131149.GA12480@lst.de> (Christoph Hellwig's message of "Thu, 19 Jul 2018 15:11:49 +0200") References: <20180708152004.21679-1-hch@lst.de> <20180708152004.21679-5-hch@lst.de> <17c45e87-d9be-8453-1bce-18753e0a68b9@infradead.org> <20180719131149.GA12480@lst.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) Date: Fri, 20 Jul 2018 21:57:36 +0200 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-=-= Christoph Hellwig writes: > On Wed, Jul 18, 2018 at 12:06:26AM -0700, Randy Dunlap wrote: >> All $ARCH look equivalent except for microblaze and nios2. >> For those, the config SWAP in init/Kconfig (line 221) comes before (and >> hence takes precedence) over arch/$(SRCARCH)/Kconfig settings, which is >> def_bool n for both microblaze and nios2. > > Both of those are NOMMU architectures, so the default SWAP > decaration should do the right thing. > > I wish the kconfig tools could warn about duplicate symbols, as they > are basically always bogus or at least very problematic. Your wish is our command ;-) A big but: duplicate symbol definitions are explicitely allowed by the kconfig language, so you find most of those duplicates are actually just varying dependencies or default values. At least, it is interesting to see how "duplicate" symbol definitions are used and perhaps this helps you with your reordering. This is just a prototype, that hopefully helps with your current task, so I did not pay too much attention to make it beautiful. Please let me know if anything is missing. Anyway, apply the patch and then invoke "make symcheckconfig" at the top-level directory. Dirk > I've update the kconfig-cleanup branch in git with the fixes, but > I didn't have time to do anything but a trivial x86 test yet. > -- > 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 --=-=-= Content-Disposition: inline; filename=symcheckconfig.patch Content-Description: symcheckconfig target diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index a3ac2c91331c..52a0ee0637e9 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -222,3 +222,8 @@ $(obj)/.%conf-cfg: $(src)/%conf-cfg.sh FORCE $(call filechk,conf_cfg) clean-files += .*conf-cfg + +PHONY += symcheckconfig + +symcheckconfig: $(obj)/conf + $< $(silent) --$@ $(Kconfig) diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c index 671ff5364497..1083ddcdd05e 100644 --- a/scripts/kconfig/conf.c +++ b/scripts/kconfig/conf.c @@ -33,6 +33,7 @@ enum input_mode { savedefconfig, listnewconfig, olddefconfig, + symcheckconfig, }; static enum input_mode input_mode = oldaskconfig; @@ -466,6 +467,7 @@ static struct option long_opts[] = { * value but not 'n') with the counter-intuitive name. */ {"oldnoconfig", no_argument, NULL, olddefconfig}, + {"symcheckconfig", no_argument, NULL, symcheckconfig}, {NULL, 0, NULL, 0} }; @@ -490,6 +492,31 @@ static void conf_usage(const char *progname) printf(" --randconfig New config with random answer to all options\n"); } +static void find_sym_dups(void) +{ + struct symbol *sym; + struct property *prop; + int i; + int cnt = 0; + char *file; + int lineno; + + for_all_symbols(i, sym) { + for_all_properties(sym, prop, P_SYMBOL) { + if (cnt == 1) { + printf("Duplicate symbol %s\n\t(%s:%d):\n", sym->name, file, lineno); + } + if (cnt) + printf("\t(%s:%d)\n", prop->file->name, prop->lineno); + + cnt += 1; + file = (char *)prop->file->name; + lineno = prop->lineno; + } + cnt = 0; + } +} + int main(int ac, char **av) { const char *progname = av[0]; @@ -560,6 +587,12 @@ int main(int ac, char **av) } name = av[optind]; conf_parse(name); + + if (input_mode == symcheckconfig) { + find_sym_dups(); + exit(0); + } + //zconfdump(stdout); if (sync_kconfig) { name = conf_get_configname(); --=-=-=--