From patchwork Mon May 20 02:54:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 164566 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp5050877ili; Sun, 19 May 2019 19:57:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqwrG0MsQSoQ9P65h1pWBkvA8vFOI14tB77UFB2WSexe4o8UA1QHUYz3ZuMm9d5JIvXXF7/6 X-Received: by 2002:a17:902:758b:: with SMTP id j11mr15506138pll.191.1558321052813; Sun, 19 May 2019 19:57:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558321052; cv=none; d=google.com; s=arc-20160816; b=CyxJ0xYh9R734it2hXStAooAhKZ0K/3k1qrrt4F8wTHckztYksGK7VjtUODanaQaXz jIY+tDonDRnKbh1vBTLt7q9kkxiHE9C61D3JyQXUK+MsDTtxzGV6RDoUtgwrJclos5X3 FvMMLboez9F2UeDW8jdPlpg9FiStWMR1BQJ4nQ+2WtPd39M2y+e4pGfSGd0uJzeQDUrv iLWSaq7QS28pkZfnZ4/Wq+VpcZBQd1Jnx+RSxbSNTTReKFY1pl9DtnL4+2gyYtgwoiI5 M+HnrEWEhNL8/9dSlSLVlQrQI7zKe7EEiDGPkcyfJ+fwKyDUG1ZexutYziR9IW+D+OTf 5i3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=ItDusmL4vzKNjFPPWLEjK7F5VrZmlSnLB0r8igrrtVc=; b=zSXLgdJUd7XZNYnBgaiFWwBvscCrcX22MdzDi16/4yaY5gtiMhzdlgx01gdMYnkjKb CMlDlMMhdsh00x976McgbZb1VPvou6ro2KDBc5sSf4LfdUS++1OO/cJmeH9HtG4m5Rxy gfGn/74JXB4VfciSGhxyGf1HCgIfRf+xgfcnzYog1Zyjbv8RyA663m17yEl3o2IK0+Z9 DK8DyzG2mRXgk062csbvMxpdggFskh+xrBgWAUtV0oMf6r3IdUAM4HHeANJ4kljmNAf8 HCeXxR7zj+cCRVd4pbN0mKwVEh6OoPOUa/d10NwlPnTHAytpeZgDQOo3ReTWQx1qY3PB bfRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=j+HUgc6I; 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 d192si16378887pgc.480.2019.05.19.19.57.32; Sun, 19 May 2019 19:57:32 -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=@nifty.com header.s=dec2015msa header.b=j+HUgc6I; 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 S1729850AbfETC5b (ORCPT + 30 others); Sun, 19 May 2019 22:57:31 -0400 Received: from conuserg-12.nifty.com ([210.131.2.79]:28041 "EHLO conuserg-12.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727087AbfETC5a (ORCPT ); Sun, 19 May 2019 22:57:30 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-12.nifty.com with ESMTP id x4K2t5bU012494; Mon, 20 May 2019 11:55:06 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com x4K2t5bU012494 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1558320907; bh=ItDusmL4vzKNjFPPWLEjK7F5VrZmlSnLB0r8igrrtVc=; h=From:To:Cc:Subject:Date:From; b=j+HUgc6Iy3uGJafJBfDatmbcg8XLfKdPcuIRs9zPkSTw6ldfduBQfjSqSj4/J910E hC3M7apPRTEoSERCF1naff7dVejPT951rueWCZkhEMre0wcFYv1daRvIZFpY2NdGeQ 0VG0Xrv16XHUgOJjy3mReHruT0bPxbkbS+dw1tXHdA45GIv/ZKKMho/VSGY/BPiFlD Tzyx87MZ53EkJDsIdDzFdVxMyo33KWgjjNcxfJvFbZUTXJZJnhtTxsbM/JT4wKbn6B U9G3B0+PND9MnvcEhCgsrDa8VW6bSGRKaG29O1G0c2hca+s7m+MLK2vcO4k6qKVmIu LC0MGL8WSbmdw== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Sam Ravnborg , Arnd Bergmann , Greg KH , Jessica Yu , Lucas De Marchi , Stephen Rothwell , Michael Schmitz , Linus Torvalds , Rusty Russell , Kees Cook , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Michael Ellerman , Masahiro Yamada , Lucas De Marchi Subject: [PATCH] kbuild: do not check name uniqueness of builtin modules Date: Mon, 20 May 2019 11:54:37 +0900 Message-Id: <20190520025437.13825-1-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I just thought it was a good idea to scan builtin.modules in the name uniqueness checking, but Stephen reported a false positive. ppc64_defconfig produces: warning: same basename if the following are built as modules: arch/powerpc/platforms/powermac/nvram.ko drivers/char/nvram.ko ..., which is a false positive because the former is never built as a module as you see in arch/powerpc/platforms/powermac/Makefile: # CONFIG_NVRAM is an arch. independent tristate symbol, for pmac32 we really # need this to be a bool. Cheat here and pretend CONFIG_NVRAM=m is really # CONFIG_NVRAM=y obj-$(CONFIG_NVRAM:m=y) += nvram.o Since we cannot predict how tricky Makefiles are written in wild, builtin.modules may potentially contain false positives. I do not think it is a big deal as far as kmod is concerned, but false positive warnings in the kernel build makes people upset. It is better to not do it. Even without checking builtin.modules, we have enough (and more solid) test coverage with allmodconfig. While I touched this part, I replaced the sed code with neater one provided by Stephen. Link: https://lkml.org/lkml/2019/5/19/120 Link: https://lkml.org/lkml/2019/5/19/123 Fixes: 3a48a91901c5 ("kbuild: check uniqueness of module names") Reported-by: Stephen Rothwell Signed-off-by: Masahiro Yamada --- scripts/modules-check.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.17.1 Acked-by: Arnd Bergmann Reviewed-by: Greg Kroah-Hartman diff --git a/scripts/modules-check.sh b/scripts/modules-check.sh index 2f659530e1ec..39e8cb36ba19 100755 --- a/scripts/modules-check.sh +++ b/scripts/modules-check.sh @@ -6,10 +6,10 @@ set -e # Check uniqueness of module names check_same_name_modules() { - for m in $(sed 's:.*/::' modules.order modules.builtin | sort | uniq -d) + for m in $(sed 's:.*/::' modules.order | sort | uniq -d) do - echo "warning: same basename if the following are built as modules:" >&2 - sed "/\/$m/!d;s:^kernel/: :" modules.order modules.builtin >&2 + echo "warning: same module names found:" >&2 + sed -n "/\/$m/s:^kernel/: :p" modules.order >&2 done }