linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Masahiro Yamada <masahiroy@kernel.org>
To: Quentin Perret <qperret@google.com>
Cc: Michal Marek <michal.lkml@markovi.net>,
	Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Cc: Android Kernel" <kernel-team@android.com>
Subject: Re: [PATCH] modpost: Make static exports fatal
Date: Tue, 1 Dec 2020 23:00:37 +0900	[thread overview]
Message-ID: <CAK7LNATj8C7C=dYcDD4M5Q-Zc_kUhY2+i6epH=LbiOAUaDZqiw@mail.gmail.com> (raw)
In-Reply-To: <20201124182420.2202514-1-qperret@google.com>

On Wed, Nov 25, 2020 at 3:24 AM Quentin Perret <qperret@google.com> wrote:
>
> Using EXPORT_SYMBOL*() on static functions is fundamentally wrong.
> Modpost currently reports that as a warning, but clearly this is not a
> pattern we should allow, and all in-tree occurences should have been
> fixed by now. So, promote the warn() message to fatal() to make sure
> this never happens again.
>
> Signed-off-by: Quentin Perret <qperret@google.com>
> ---
>  scripts/mod/modpost.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
> index f882ce0d9327..70b0e825a139 100644
> --- a/scripts/mod/modpost.c
> +++ b/scripts/mod/modpost.c
> @@ -2663,9 +2663,9 @@ int main(int argc, char **argv)
>
>                 for (s = symbolhash[n]; s; s = s->next) {
>                         if (s->is_static)
> -                               warn("\"%s\" [%s] is a static %s\n",
> -                                    s->name, s->module->name,
> -                                    export_str(s->export));
> +                               fatal("\"%s\" [%s] is a static %s\n",
> +                                     s->name, s->module->name,
> +                                     export_str(s->export));
>                 }
>         }
>
> --
> 2.29.2.454.gaff20da3a2-goog
>


I am not a big fan of (ab)using fatal() for this case.

Please consider using error() once
the following is queued up.

https://patchwork.kernel.org/project/linux-kbuild/patch/20201201103418.675850-2-masahiroy@kernel.org/




-- 
Best Regards
Masahiro Yamada

  parent reply	other threads:[~2020-12-01 14:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-24 18:24 [PATCH] modpost: Make static exports fatal Quentin Perret
2020-11-24 19:55 ` Greg KH
2020-11-25 10:35 ` Matthias Maennich
2020-12-01 14:00 ` Masahiro Yamada [this message]
2020-12-01 14:13   ` Quentin Perret

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='CAK7LNATj8C7C=dYcDD4M5Q-Zc_kUhY2+i6epH=LbiOAUaDZqiw@mail.gmail.com' \
    --to=masahiroy@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel-team@android.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.lkml@markovi.net \
    --cc=qperret@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;
as well as URLs for NNTP newsgroup(s).