[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250710094816.771656-1-andriy.shevchenko@linux.intel.com>
Date: Thu, 10 Jul 2025 12:48:16 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Feng Tang <feng.tang@...ux.alibaba.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
linux-kernel@...r.kernel.org
Cc: Andrew Morton <akpm@...ux-foundation.org>
Subject: [PATCH v1 1/1] panic: Fix compilation error (`make W=1`)
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@...ux.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
Powered by blists - more mailing lists