Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

kernel/hung_task.c: set some hung_task.c variables storage-class-specifier to static

smatch reports several warnings
kernel/hung_task.c:31:19: warning:
symbol 'sysctl_hung_task_check_count' was not declared. Should it be static?
kernel/hung_task.c:50:29: warning:
symbol 'sysctl_hung_task_check_interval_secs' was not declared. Should it be static?
kernel/hung_task.c:52:19: warning:
symbol 'sysctl_hung_task_warnings' was not declared. Should it be static?
kernel/hung_task.c:75:28: warning:
symbol 'sysctl_hung_task_panic' was not declared. Should it be static?

These variables are only used in hung_task.c, so they should be static

Link: https://lkml.kernel.org/r/20230312164645.471259-1-trix@redhat.com
Signed-off-by: Tom Rix <trix@redhat.com>
Cc: Ben Dooks <ben.dooks@sifive.com>
Cc: fuyuanli <fuyuanli@didiglobal.com>
Cc: John Ogness <john.ogness@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Petr Mladek <pmladek@suse.com>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Tom Rix and committed by
Andrew Morton
882c5b26 725e3740

+5 -5
+5 -5
kernel/hung_task.c
··· 28 28 /* 29 29 * The number of tasks checked: 30 30 */ 31 - int __read_mostly sysctl_hung_task_check_count = PID_MAX_LIMIT; 31 + static int __read_mostly sysctl_hung_task_check_count = PID_MAX_LIMIT; 32 32 33 33 /* 34 34 * Limit number of tasks checked in a batch. ··· 47 47 /* 48 48 * Zero (default value) means use sysctl_hung_task_timeout_secs: 49 49 */ 50 - unsigned long __read_mostly sysctl_hung_task_check_interval_secs; 50 + static unsigned long __read_mostly sysctl_hung_task_check_interval_secs; 51 51 52 - int __read_mostly sysctl_hung_task_warnings = 10; 52 + static int __read_mostly sysctl_hung_task_warnings = 10; 53 53 54 54 static int __read_mostly did_panic; 55 55 static bool hung_task_show_lock; ··· 72 72 * Should we panic (and reboot, if panic_timeout= is set) when a 73 73 * hung task is detected: 74 74 */ 75 - unsigned int __read_mostly sysctl_hung_task_panic = 76 - IS_ENABLED(CONFIG_BOOTPARAM_HUNG_TASK_PANIC); 75 + static unsigned int __read_mostly sysctl_hung_task_panic = 76 + IS_ENABLED(CONFIG_BOOTPARAM_HUNG_TASK_PANIC); 77 77 78 78 static int 79 79 hung_task_panic(struct notifier_block *this, unsigned long event, void *ptr)