From: Arnd Bergmann <arnd@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>,
Douglas Anderson <dianders@chromium.org>
Cc: Petr Mladek <pmladek@suse.com>, Arnd Bergmann <arnd@arndb.de>,
Pingfan Liu <kernelfans@gmail.com>,
Lecopzer Chen <lecopzer.chen@mediatek.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH 1/2] watchdog/hardlockup: avoid unused-function warning
Date: Fri, 4 Aug 2023 15:27:50 +0200 [thread overview]
Message-ID: <20230804132800.2270896-1-arnd@kernel.org> (raw)
From: Arnd Bergmann <arnd@arndb.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@arndb.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
next reply other threads:[~2023-08-04 13:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-04 13:27 Arnd Bergmann [this message]
2023-08-04 13:27 ` [PATCH 2/2] watchdog/hardlockup: simplify Kconfig selection Arnd Bergmann
2023-08-04 14:06 ` Doug Anderson
2023-08-04 14:03 ` [PATCH 1/2] watchdog/hardlockup: avoid unused-function warning Doug Anderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230804132800.2270896-1-arnd@kernel.org \
--to=arnd@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=dianders@chromium.org \
--cc=kernelfans@gmail.com \
--cc=lecopzer.chen@mediatek.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pmladek@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox