Message ID | 20230606094159.1910369-1-masahiroy@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3283326vqr; Tue, 6 Jun 2023 03:16:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5qnSJMeLqWrGBskjRMryay8CqRfEe8ED8CHW0RBP5aHzO0XNemSbOzZ55UkXIsOkVck7Sn X-Received: by 2002:a05:620a:472a:b0:75b:23a0:de9e with SMTP id bs42-20020a05620a472a00b0075b23a0de9emr1900280qkb.28.1686046581533; Tue, 06 Jun 2023 03:16:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686046581; cv=none; d=google.com; s=arc-20160816; b=lu7HZhdLoyU3f6+kRan+e0m2/U7RaGdahsCLNi6vDVFZSBBt7J8WWmwO4DETSiV8HN YjXaM2USQeQh0gNeR7Vs880iH9yj6leQqVgCrI4JyPNQE5rAG8GSugWKb8EoTO8KsG/r 1b9uN7qMTejt4bHXpVGfLxhc5ZJYPo/c4/XcHCdLQc1vKw/Fw93BbweLg65OkX/UhrTQ VrJDkjs6JwHg0oIlNS1G1gPCq9h3f++d1uqcSSCO6DeewGOon2W/1R/vCUqj2ELS4ZZr dp/AVE9s2AGPF6heMuc/mVygNchCxzJ5NMgF5cTGMYXN7Op/Gw6zwVF3dpbG1/pcLYql MB5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=Nb9yJAkg+2cqqF4Gh8baS8fXP7pi0sTyJOi0hT8+Ezo=; b=O8CW6lq1zAs+o7dP0jbr11BYRNlldmoCRk0/mgO8bc+ZwkxEjWg3X63RRAjnTrVfMu RuJLg00eRo8M4PWCVSNKlETohtogdL/4K1S2P4CPHy/RRwn3G3x35w0lspsxf5LRcAr3 7Rb2HxXOQbkl8DACZxIvj87Y5oNNUcLTNFs4W5zVZezXTLpQ0gJbEKiK3hY6iCnLnFzi oJGsVrL4NaK1wS6VO623S4ThJH8+0KJJX/yhLIoR9afHcdhwP6BkP6BMnthYSVIfrPHT wL1JLqYsdRfv/6TTzuwyqPjH5YXufeKBtBE2ivVQvVYWiyAFn3LrccOrcUzlEMa7F5/X paew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GBNobWZy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s24-20020ae9f718000000b0075d005b5472si5313037qkg.705.2023.06.06.03.16.07; Tue, 06 Jun 2023 03:16:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GBNobWZy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236652AbjFFJnF (ORCPT <rfc822;xxoosimple@gmail.com> + 99 others); Tue, 6 Jun 2023 05:43:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237103AbjFFJmu (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 6 Jun 2023 05:42:50 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 819A710E5; Tue, 6 Jun 2023 02:42:49 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 015636264C; Tue, 6 Jun 2023 09:42:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 32F31C4339B; Tue, 6 Jun 2023 09:42:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686044568; bh=veE+fl10BprFYlWZLZVVUUJiYrObzEPENxfuVNrEcOQ=; h=From:To:Cc:Subject:Date:From; b=GBNobWZy7SwC/cebnMZSenZBwru9FKLP8XS5e4rq87U4wSZBeSXh2EVetUVt2A3gs W9arwvDlhlSEPwyW+l/9aineUDMqr7j+t9AiCFlKb6X0NrKJ8VfbqX5xnZukq5j03x vn8Mq+8qAwr6Sj6pBvycfG2luJx1/M3UG0MbEHD76QMjUm8ykMo6WlOd82qRt+vgP0 /1d+02nzwUd1uqEXi/7Wgr8H9XRYv1fBudnjf5Dssfak6+ipF0oxODLuzDOSIQv0ix Jl+ZbWiZRFEHL16A7j4Ujk7nTHYQYNQts9qd07uYlQyufhn15jb+XpzI/7nlDKAxMG xRXrcQ3MFitJw== From: Masahiro Yamada <masahiroy@kernel.org> To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada <masahiroy@kernel.org>, Nathan Chancellor <nathan@kernel.org>, Nick Desaulniers <ndesaulniers@google.com>, Nicolas Schier <nicolas@fjasle.eu> Subject: [PATCH] modpost: propagate W=1 build option to modpost Date: Tue, 6 Jun 2023 18:41:59 +0900 Message-Id: <20230606094159.1910369-1-masahiroy@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767947980267291979?= X-GMAIL-MSGID: =?utf-8?q?1767947980267291979?= |
Series |
modpost: propagate W=1 build option to modpost
|
|
Commit Message
Masahiro Yamada
June 6, 2023, 9:41 a.m. UTC
"No build warning" is a strong requirement these days, so you must fix
all issues before enabling a new warning flag.
We often add a new warning to W=1 first so that the kbuild test robot
blocks new breakages.
This commit allows modpost to show extra warnings only when W=1
(or KBUILD_EXTRA_WARN=1) is given.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
scripts/Makefile.modpost | 1 +
scripts/mod/modpost.c | 7 ++++++-
2 files changed, 7 insertions(+), 1 deletion(-)
Comments
On Tue, Jun 6, 2023 at 2:42 AM Masahiro Yamada <masahiroy@kernel.org> wrote: > > "No build warning" is a strong requirement these days, so you must fix > all issues before enabling a new warning flag. > > We often add a new warning to W=1 first so that the kbuild test robot > blocks new breakages. > > This commit allows modpost to show extra warnings only when W=1 > (or KBUILD_EXTRA_WARN=1) is given. > > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Patch seems fine, but without anyone reading extra_warn, I'm curious what new extra warnings you had in mind were? > --- > > scripts/Makefile.modpost | 1 + > scripts/mod/modpost.c | 7 ++++++- > 2 files changed, 7 insertions(+), 1 deletion(-) > > diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost > index 0980c58d8afc..074e27c0c140 100644 > --- a/scripts/Makefile.modpost > +++ b/scripts/Makefile.modpost > @@ -47,6 +47,7 @@ modpost-args = \ > $(if $(KBUILD_MODPOST_WARN),-w) \ > $(if $(KBUILD_NSDEPS),-d $(MODULES_NSDEPS)) \ > $(if $(CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS)$(KBUILD_NSDEPS),-N) \ > + $(if $(findstring 1, $(KBUILD_EXTRA_WARN)),-W) \ > -o $@ > > modpost-deps := $(MODPOST) > diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c > index d10f5bdcb753..3ea5eb2b1029 100644 > --- a/scripts/mod/modpost.c > +++ b/scripts/mod/modpost.c > @@ -42,6 +42,8 @@ static bool allow_missing_ns_imports; > > static bool error_occurred; > > +static bool extra_warn; > + > /* > * Cut off the warnings when there are too many. This typically occurs when > * vmlinux is missing. ('make modules' without building vmlinux.) > @@ -2199,7 +2201,7 @@ int main(int argc, char **argv) > LIST_HEAD(dump_lists); > struct dump_list *dl, *dl2; > > - while ((opt = getopt(argc, argv, "ei:mnT:o:awENd:")) != -1) { > + while ((opt = getopt(argc, argv, "ei:mnT:o:aWwENd:")) != -1) { > switch (opt) { > case 'e': > external_module = true; > @@ -2224,6 +2226,9 @@ int main(int argc, char **argv) > case 'T': > files_source = optarg; > break; > + case 'W': > + extra_warn = true; > + break; > case 'w': > warn_unresolved = true; > break; > -- > 2.39.2 >
On Wed, Jun 7, 2023 at 1:56 AM Nick Desaulniers <ndesaulniers@google.com> wrote: > > On Tue, Jun 6, 2023 at 2:42 AM Masahiro Yamada <masahiroy@kernel.org> wrote: > > > > "No build warning" is a strong requirement these days, so you must fix > > all issues before enabling a new warning flag. > > > > We often add a new warning to W=1 first so that the kbuild test robot > > blocks new breakages. > > > > This commit allows modpost to show extra warnings only when W=1 > > (or KBUILD_EXTRA_WARN=1) is given. > > > > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> > > Patch seems fine, but without anyone reading extra_warn, I'm curious > what new extra warnings you had in mind were? This one. https://lore.kernel.org/linux-kbuild/CAK7LNAR0uMvf+k7LPXtMjigKFPeNu5m5EhAkvk2RVRHkdjdbdg@mail.gmail.com/T/#m0f41f2c8fe843133ce8100088443491a51d496af > > --- > > > > scripts/Makefile.modpost | 1 + > > scripts/mod/modpost.c | 7 ++++++- > > 2 files changed, 7 insertions(+), 1 deletion(-) > > > > diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost > > index 0980c58d8afc..074e27c0c140 100644 > > --- a/scripts/Makefile.modpost > > +++ b/scripts/Makefile.modpost > > @@ -47,6 +47,7 @@ modpost-args = \ > > $(if $(KBUILD_MODPOST_WARN),-w) \ > > $(if $(KBUILD_NSDEPS),-d $(MODULES_NSDEPS)) \ > > $(if $(CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS)$(KBUILD_NSDEPS),-N) \ > > + $(if $(findstring 1, $(KBUILD_EXTRA_WARN)),-W) \ > > -o $@ > > > > modpost-deps := $(MODPOST) > > diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c > > index d10f5bdcb753..3ea5eb2b1029 100644 > > --- a/scripts/mod/modpost.c > > +++ b/scripts/mod/modpost.c > > @@ -42,6 +42,8 @@ static bool allow_missing_ns_imports; > > > > static bool error_occurred; > > > > +static bool extra_warn; > > + > > /* > > * Cut off the warnings when there are too many. This typically occurs when > > * vmlinux is missing. ('make modules' without building vmlinux.) > > @@ -2199,7 +2201,7 @@ int main(int argc, char **argv) > > LIST_HEAD(dump_lists); > > struct dump_list *dl, *dl2; > > > > - while ((opt = getopt(argc, argv, "ei:mnT:o:awENd:")) != -1) { > > + while ((opt = getopt(argc, argv, "ei:mnT:o:aWwENd:")) != -1) { > > switch (opt) { > > case 'e': > > external_module = true; > > @@ -2224,6 +2226,9 @@ int main(int argc, char **argv) > > case 'T': > > files_source = optarg; > > break; > > + case 'W': > > + extra_warn = true; > > + break; > > case 'w': > > warn_unresolved = true; > > break; > > -- > > 2.39.2 > > > > > -- > Thanks, > ~Nick Desaulniers
On Tue, Jun 6, 2023 at 10:21 AM Masahiro Yamada <masahiroy@kernel.org> wrote: > > On Wed, Jun 7, 2023 at 1:56 AM Nick Desaulniers <ndesaulniers@google.com> wrote: > > > > On Tue, Jun 6, 2023 at 2:42 AM Masahiro Yamada <masahiroy@kernel.org> wrote: > > > > > > "No build warning" is a strong requirement these days, so you must fix > > > all issues before enabling a new warning flag. > > > > > > We often add a new warning to W=1 first so that the kbuild test robot > > > blocks new breakages. > > > > > > This commit allows modpost to show extra warnings only when W=1 > > > (or KBUILD_EXTRA_WARN=1) is given. > > > > > > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> > > > > Patch seems fine, but without anyone reading extra_warn, I'm curious > > what new extra warnings you had in mind were? > > > This one. > > https://lore.kernel.org/linux-kbuild/CAK7LNAR0uMvf+k7LPXtMjigKFPeNu5m5EhAkvk2RVRHkdjdbdg@mail.gmail.com/T/#m0f41f2c8fe843133ce8100088443491a51d496af Yeah, ok so we'll guard that warning on this extra_warn then? Seems fine. Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> > > > > > --- > > > > > > scripts/Makefile.modpost | 1 + > > > scripts/mod/modpost.c | 7 ++++++- > > > 2 files changed, 7 insertions(+), 1 deletion(-) > > > > > > diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost > > > index 0980c58d8afc..074e27c0c140 100644 > > > --- a/scripts/Makefile.modpost > > > +++ b/scripts/Makefile.modpost > > > @@ -47,6 +47,7 @@ modpost-args = \ > > > $(if $(KBUILD_MODPOST_WARN),-w) \ > > > $(if $(KBUILD_NSDEPS),-d $(MODULES_NSDEPS)) \ > > > $(if $(CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS)$(KBUILD_NSDEPS),-N) \ > > > + $(if $(findstring 1, $(KBUILD_EXTRA_WARN)),-W) \ > > > -o $@ > > > > > > modpost-deps := $(MODPOST) > > > diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c > > > index d10f5bdcb753..3ea5eb2b1029 100644 > > > --- a/scripts/mod/modpost.c > > > +++ b/scripts/mod/modpost.c > > > @@ -42,6 +42,8 @@ static bool allow_missing_ns_imports; > > > > > > static bool error_occurred; > > > > > > +static bool extra_warn; > > > + > > > /* > > > * Cut off the warnings when there are too many. This typically occurs when > > > * vmlinux is missing. ('make modules' without building vmlinux.) > > > @@ -2199,7 +2201,7 @@ int main(int argc, char **argv) > > > LIST_HEAD(dump_lists); > > > struct dump_list *dl, *dl2; > > > > > > - while ((opt = getopt(argc, argv, "ei:mnT:o:awENd:")) != -1) { > > > + while ((opt = getopt(argc, argv, "ei:mnT:o:aWwENd:")) != -1) { > > > switch (opt) { > > > case 'e': > > > external_module = true; > > > @@ -2224,6 +2226,9 @@ int main(int argc, char **argv) > > > case 'T': > > > files_source = optarg; > > > break; > > > + case 'W': > > > + extra_warn = true; > > > + break; > > > case 'w': > > > warn_unresolved = true; > > > break; > > > -- > > > 2.39.2 > > > > > > > > > -- > > Thanks, > > ~Nick Desaulniers > > > > -- > Best Regards > Masahiro Yamada
diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost index 0980c58d8afc..074e27c0c140 100644 --- a/scripts/Makefile.modpost +++ b/scripts/Makefile.modpost @@ -47,6 +47,7 @@ modpost-args = \ $(if $(KBUILD_MODPOST_WARN),-w) \ $(if $(KBUILD_NSDEPS),-d $(MODULES_NSDEPS)) \ $(if $(CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS)$(KBUILD_NSDEPS),-N) \ + $(if $(findstring 1, $(KBUILD_EXTRA_WARN)),-W) \ -o $@ modpost-deps := $(MODPOST) diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index d10f5bdcb753..3ea5eb2b1029 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -42,6 +42,8 @@ static bool allow_missing_ns_imports; static bool error_occurred; +static bool extra_warn; + /* * Cut off the warnings when there are too many. This typically occurs when * vmlinux is missing. ('make modules' without building vmlinux.) @@ -2199,7 +2201,7 @@ int main(int argc, char **argv) LIST_HEAD(dump_lists); struct dump_list *dl, *dl2; - while ((opt = getopt(argc, argv, "ei:mnT:o:awENd:")) != -1) { + while ((opt = getopt(argc, argv, "ei:mnT:o:aWwENd:")) != -1) { switch (opt) { case 'e': external_module = true; @@ -2224,6 +2226,9 @@ int main(int argc, char **argv) case 'T': files_source = optarg; break; + case 'W': + extra_warn = true; + break; case 'w': warn_unresolved = true; break;