* [PATCH] modpost: Make static exports fatal
@ 2020-11-24 18:24 Quentin Perret
2020-11-24 19:55 ` Greg KH
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Quentin Perret @ 2020-11-24 18:24 UTC (permalink / raw
To: Masahiro Yamada, Michal Marek, linux-kbuild, linux-kernel
Cc: gregkh, kernel-team, Quentin Perret
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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] modpost: Make static exports fatal
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
2 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2020-11-24 19:55 UTC (permalink / raw
To: Quentin Perret
Cc: Masahiro Yamada, Michal Marek, linux-kbuild, linux-kernel,
kernel-team
On Tue, Nov 24, 2020 at 06:24:09PM +0000, Quentin Perret 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));
> }
> }
>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] modpost: Make static exports fatal
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
2 siblings, 0 replies; 5+ messages in thread
From: Matthias Maennich @ 2020-11-25 10:35 UTC (permalink / raw
To: Quentin Perret
Cc: Masahiro Yamada, Michal Marek, linux-kbuild, linux-kernel, gregkh,
kernel-team
On Tue, Nov 24, 2020 at 06:24:09PM +0000, Quentin Perret 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>
Reviewed-by: Matthias Maennich <maennich@google.com>
Cheers,
Matthias
>---
> 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
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] modpost: Make static exports fatal
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
2020-12-01 14:13 ` Quentin Perret
2 siblings, 1 reply; 5+ messages in thread
From: Masahiro Yamada @ 2020-12-01 14:00 UTC (permalink / raw
To: Quentin Perret
Cc: Michal Marek, Linux Kbuild mailing list,
Linux Kernel Mailing List, Greg Kroah-Hartman, Cc: Android Kernel
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] modpost: Make static exports fatal
2020-12-01 14:00 ` Masahiro Yamada
@ 2020-12-01 14:13 ` Quentin Perret
0 siblings, 0 replies; 5+ messages in thread
From: Quentin Perret @ 2020-12-01 14:13 UTC (permalink / raw
To: Masahiro Yamada
Cc: Michal Marek, Linux Kbuild mailing list,
Linux Kernel Mailing List, Greg Kroah-Hartman, Cc: Android Kernel
On Tuesday 01 Dec 2020 at 23:00:37 (+0900), Masahiro Yamada wrote:
> 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/
Yes, much nicer, thanks for that series.
I'll post a v2 shortly.
Thanks,
Quentin
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-12-01 14:14 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2020-12-01 14:13 ` Quentin Perret
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.