2022-02-16 07:11:25

by Jiapeng Chong

[permalink] [raw]
Subject: [PATCH] printk: make suppress_panic_printk static

This symbol is not used outside of printk.c, so marks it static.

Fix the following sparse warning:

kernel/printk/printk.c:100:19: warning: symbol 'suppress_panic_printk'
was not declared. Should it be static?

Reported-by: Abaci Robot <[email protected]>
Signed-off-by: Jiapeng Chong <[email protected]>
---
kernel/printk/printk.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index 7a9eace19191..703397cadd01 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -97,7 +97,7 @@ int __read_mostly suppress_printk;
* During panic, heavy printk by other CPUs can delay the
* panic and risk deadlock on console resources.
*/
-int __read_mostly suppress_panic_printk;
+static int __read_mostly suppress_panic_printk;

#ifdef CONFIG_LOCKDEP
static struct lockdep_map console_lock_dep_map = {
--
2.20.1.7.g153144c


2022-02-16 10:44:16

by Miguel Ojeda

[permalink] [raw]
Subject: Re: [PATCH] printk: make suppress_panic_printk static

On Wed, Feb 16, 2022 at 4:20 AM Jiapeng Chong
<[email protected]> wrote:
>
> This symbol is not used outside of printk.c, so marks it static.
>
> Fix the following sparse warning:
>
> kernel/printk/printk.c:100:19: warning: symbol 'suppress_panic_printk'
> was not declared. Should it be static?
>
> Reported-by: Abaci Robot <[email protected]>
> Signed-off-by: Jiapeng Chong <[email protected]>

It could be good to mention this is based on -next.

Reviewed-by: Miguel Ojeda <[email protected]>

Cheers,
Miguel

2022-02-22 05:23:37

by Petr Mladek

[permalink] [raw]
Subject: Re: [PATCH] printk: make suppress_panic_printk static

On Wed 2022-02-16 11:19:57, Jiapeng Chong wrote:
> This symbol is not used outside of printk.c, so marks it static.
>
> Fix the following sparse warning:
>
> kernel/printk/printk.c:100:19: warning: symbol 'suppress_panic_printk'
> was not declared. Should it be static?
>
> Reported-by: Abaci Robot <[email protected]>
> Signed-off-by: Jiapeng Chong <[email protected]>

The patch has been committed into printk/linux.git,
branch for-5.18-panic-deadlocks.

Best Regards,
Petr