lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230804132800.2270896-1-arnd@kernel.org>
Date:   Fri,  4 Aug 2023 15:27:50 +0200
From:   Arnd Bergmann <arnd@...nel.org>
To:     Andrew Morton <akpm@...ux-foundation.org>,
        Douglas Anderson <dianders@...omium.org>
Cc:     Petr Mladek <pmladek@...e.com>, Arnd Bergmann <arnd@...db.de>,
        Pingfan Liu <kernelfans@...il.com>,
        Lecopzer Chen <lecopzer.chen@...iatek.com>,
        linux-kernel@...r.kernel.org
Subject: [PATCH 1/2] watchdog/hardlockup: avoid unused-function warning

From: Arnd Bergmann <arnd@...db.de>

The newly added hardlockup_all_cpu_backtrace_proc_handler() function is defined
in some configurations that don't actually call it:

kernel/watchdog.c:112:12: error: 'hardlockup_all_cpu_backtrace_proc_handler' defined but not used [-Werror=unused-function]
  112 | static int hardlockup_all_cpu_backtrace_proc_handler(struct ctl_table *table, int write,
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Hide the definition when either CONFIG_SMP or CONFIG_SYSCTL are disabled and
the function is not actually needed.

Fixes: 838b3b76220d5 ("watchdog/hardlockup: avoid large stack frames in watchdog_hardlockup_check()")
Signed-off-by: Arnd Bergmann <arnd@...db.de>
---
 kernel/watchdog.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/watchdog.c b/kernel/watchdog.c
index 25d5627a6580b..0dd6a7acacd97 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -108,6 +108,7 @@ notrace void arch_touch_nmi_watchdog(void)
 }
 EXPORT_SYMBOL(arch_touch_nmi_watchdog);
 
+#if defined(CONFIG_SMP) && defined(CONFIG_SYSCTL)
 static int hardlockup_all_cpu_backtrace_proc_handler(struct ctl_table *table, int write,
 		  void *buffer, size_t *lenp, loff_t *ppos)
 {
@@ -130,6 +131,7 @@ static int hardlockup_all_cpu_backtrace_proc_handler(struct ctl_table *table, in
 
 	return ret;
 }
+#endif
 
 void watchdog_hardlockup_touch_cpu(unsigned int cpu)
 {
-- 
2.39.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ