lkml.org 
[lkml]   [2020]   [Dec]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] modpost: Make static exports fatal
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

\
 
 \ /
  Last update: 2020-12-01 15:04    [W:0.094 / U:1.516 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site