mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Masahiro Yamada <masahiroy@kernel.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>,
	Kai Vehmanen <kai.vehmanen@linux.intel.com>,
	Filipe Brandenburger <filbranden@google.com>,
	Greg Thelen <gthelen@google.com>,
	Michael Davidson <md@google.com>,
	Eugene Surovegin <surovegin@google.com>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	Michal Marek <michal.lkml@markovi.net>,
	Jonathan Corbet <corbet@lwn.net>,
	"open list:DOCUMENTATION" <linux-doc@vger.kernel.org>
Subject: Re: [PATCH] modpost: allow modpost to fail on warnings
Date: Mon, 21 Sep 2020 09:50:56 -0500	[thread overview]
Message-ID: <d14745a6-fbdc-ff84-5553-18af6d922989@linux.intel.com> (raw)
In-Reply-To: <CAK7LNATUcRpCvu9iQd_s9i5+3kRA96O+DMd-QGbAu-swmVuauw@mail.gmail.com>

Thanks for the review,

>> Set KBUILD_MODPOST_FAIL_ON_WARNINGS to a non-empty value to make the
>> kbuild fail when modpost generates any warnings. This will avoid
>> misses such as [1] where the SOF CI did not catch a missing module
>> license.
>>
>> This was initially contributed in 2016 [2], rebase/clean-ups and tests
>> by Pierre Bossart.
>>
>> Test example:
>> $ KBUILD_MODPOST_FAIL_ON_WARNINGS=1 make
>>    GEN     Makefile
>>    DESCEND  objtool
>>    CALL    sof-dev/scripts/atomic/check-atomics.sh
>>    CALL    sof-dev/scripts/checksyscalls.sh
>>    CHK     include/generated/compile.h
>>    MODPOST Module.symvers
>> Kernel: arch/x86/boot/bzImage is ready  (#13)
>> WARNING: modpost: missing MODULE_LICENSE() in sound/soc/intel/boards/snd-soc-sof-sdw.o
>> make[2]: *** [sof-dev/scripts/Makefile.modpost:114: Module.symvers] Error 2
> 
> 
> I think [1] should be an error instead of a warning
> by default.

would the following patch be what you have in mind?

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 422f1cfca289..ae1eb67aa0f2 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -2018,7 +2018,7 @@ static void read_symbols(const char *modname)
         if (!mod->is_vmlinux) {
                 license = get_modinfo(&info, "license");
                 if (!license)
-                       warn("missing MODULE_LICENSE() in %s\n", modname);
+                       error("missing MODULE_LICENSE() in %s\n", modname);
                 while (license) {
                         if (license_is_gpl_compatible(license))
                                 mod->gpl_compatible = 1;


If yes, also wondering if we can still add the option to treat warnings 
as errors as an opt-in behavior?

Thanks!
-Pierre

  reply	other threads:[~2020-09-21 14:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-18 21:50 Pierre-Louis Bossart
2020-09-19  6:21 ` Masahiro Yamada
2020-09-21 14:50   ` Pierre-Louis Bossart [this message]
2020-09-24 17:22     ` Masahiro Yamada
2020-09-24 18:13       ` Pierre-Louis Bossart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d14745a6-fbdc-ff84-5553-18af6d922989@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=corbet@lwn.net \
    --cc=filbranden@google.com \
    --cc=gthelen@google.com \
    --cc=kai.vehmanen@linux.intel.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=md@google.com \
    --cc=michal.lkml@markovi.net \
    --cc=sfr@canb.auug.org.au \
    --cc=surovegin@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®