All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/1] panic: Fix compilation error (`make W=1`)
@ 2025-07-10  9:48 Andy Shevchenko
       [not found] ` <aG-Y2RhcxgrWuq27@U-2FWC9VHC-2323.local>
  2025-07-10 22:01 ` Andrew Morton
  0 siblings, 2 replies; 9+ messages in thread
From: Andy Shevchenko @ 2025-07-10  9:48 UTC (permalink / raw)
  To: Feng Tang, Andy Shevchenko, linux-kernel; +Cc: Andrew Morton

Compiler is not happy about the recently added code:

lib/sys_info.c:52:19: error: variable 'sys_info_avail' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration]
   52 | static const char sys_info_avail[] = "tasks,mem,timers,locks,ftrace,all_bt,blocked_tasks";
      |                   ^~~~~~~~~~~~~~

Fix it in the same way how, for example, lib/vsprintf.c does in the similar
cases, i.e. by using string literal directly as sizeof() parameter.

Fixes: 9b5072c04c46 ("panic: add 'panic_sys_info' sysctl to take human readable string parameter")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 lib/sys_info.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/lib/sys_info.c b/lib/sys_info.c
index 46d6f4f1ad2a..779f8725b194 100644
--- a/lib/sys_info.c
+++ b/lib/sys_info.c
@@ -49,13 +49,11 @@ unsigned long sys_info_parse_param(char *str)
 
 #ifdef CONFIG_SYSCTL
 
-static const char sys_info_avail[] = "tasks,mem,timers,locks,ftrace,all_bt,blocked_tasks";
-
 int sysctl_sys_info_handler(const struct ctl_table *ro_table, int write,
 					  void *buffer, size_t *lenp,
 					  loff_t *ppos)
 {
-	char names[sizeof(sys_info_avail) + 1];
+	char names[sizeof("tasks,mem,timers,locks,ftrace,all_bt,blocked_tasks") + 1];
 	struct ctl_table table;
 	unsigned long *si_bits_global;
 
-- 
2.47.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-07-11  6:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-10  9:48 [PATCH v1 1/1] panic: Fix compilation error (`make W=1`) Andy Shevchenko
     [not found] ` <aG-Y2RhcxgrWuq27@U-2FWC9VHC-2323.local>
     [not found]   ` <aG--Yu57lpHnroCe@smile.fi.intel.com>
2025-07-10 13:24     ` Andy Shevchenko
2025-07-10 22:01 ` Andrew Morton
2025-07-11  0:54   ` Feng Tang
2025-07-11  1:49     ` Nathan Chancellor
2025-07-11  2:48       ` Feng Tang
2025-07-11  6:04         ` Andy Shevchenko
2025-07-11  6:44           ` Andy Shevchenko
2025-07-11  6:01     ` Andy Shevchenko

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.