From: Arnd Bergmann <arnd@kernel•org>
To: Andrew Morton <akpm@linux-foundation•org>
Cc: linux-kselftest@vger•kernel.org,
"Rafael J. Wysocki" <rafael@kernel•org>,
Peter Zijlstra <peterz@infradead•org>,
Catalin Marinas <catalin.marinas@arm•com>,
linux-mips@vger•kernel.org, linux-mm@kvack•org,
Pavel Machek <pavel@ucw•cz>, Christoph Lameter <cl@linux•com>,
Will Deacon <will@kernel•org>,
linux-riscv@lists•infradead.org, linux-s390@vger•kernel.org,
Paul Moore <paul@paul-moore•com>,
linux-sh@vger•kernel.org, Helge Deller <deller@gmx•de>,
x86@kernel•org, Russell King <linux@armlinux•org.uk>,
Ingo Molnar <mingo@redhat•com>, Dennis Zhou <dennis@kernel•org>,
Boqun Feng <boqun.feng@gmail•com>, Arnd Bergmann <arnd@arndb•de>,
linux-pm@vger•kernel.org, Heiko Carstens <hca@linux•ibm.com>,
Waiman Long <longman@redhat•com>,
Thomas Gleixner <tglx@linutronix•de>,
linux-arm-kernel@lists•infradead.org, kunit-dev@googlegroups•com,
Michal Simek <monstr@monstr•eu>,
Thomas Bogendoerfer <tsbogend@alpha•franken.de>,
linux-parisc@vger•kernel.org, linux-kernel@vger•kernel.org,
Eric Paris <eparis @redhat.com>,
audit@vger•kernel.org, Palmer Dabbelt <palmer@dabbelt•com>,
Tejun Heo <tj@kernel•org>,
linuxppc-dev@lists•ozlabs.org
Subject: [PATCH 08/14] panic: make function declarations visible
Date: Wed, 17 May 2023 15:10:56 +0200 [thread overview]
Message-ID: <20230517131102.934196-9-arnd@kernel.org> (raw)
In-Reply-To: <20230517131102.934196-1-arnd@kernel.org>
From: Arnd Bergmann <arnd@arndb•de>
A few panic() related functions have a global definition but
not declaration, which causes a warning with W=1:
kernel/panic.c:710:6: error: no previous prototype for '__warn_printk' [-Werror=missing-prototypes]
kernel/panic.c:756:24: error: no previous prototype for '__stack_chk_fail' [-Werror=missing-prototypes]
kernel/exit.c:1917:32: error: no previous prototype for 'abort' [-Werror=missing-prototypes]
__warn_printk() is called both as a global function when CONFIG_BUG
is enabled, and as a local function in other configs. The other
two here are called indirectly from generated or assembler code.
Add prototypes for all of these.
Signed-off-by: Arnd Bergmann <arnd@arndb•de>
---
include/asm-generic/bug.h | 5 +++--
include/linux/panic.h | 3 +++
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h
index 4050b191e1a9..6e794420bd39 100644
--- a/include/asm-generic/bug.h
+++ b/include/asm-generic/bug.h
@@ -87,10 +87,12 @@ struct bug_entry {
*
* Use the versions with printk format strings to provide better diagnostics.
*/
-#ifndef __WARN_FLAGS
extern __printf(4, 5)
void warn_slowpath_fmt(const char *file, const int line, unsigned taint,
const char *fmt, ...);
+extern __printf(1, 2) void __warn_printk(const char *fmt, ...);
+
+#ifndef __WARN_FLAGS
#define __WARN() __WARN_printf(TAINT_WARN, NULL)
#define __WARN_printf(taint, arg...) do { \
instrumentation_begin(); \
@@ -98,7 +100,6 @@ void warn_slowpath_fmt(const char *file, const int line, unsigned taint,
instrumentation_end(); \
} while (0)
#else
-extern __printf(1, 2) void __warn_printk(const char *fmt, ...);
#define __WARN() __WARN_FLAGS(BUGFLAG_TAINT(TAINT_WARN))
#define __WARN_printf(taint, arg...) do { \
instrumentation_begin(); \
diff --git a/include/linux/panic.h b/include/linux/panic.h
index 979b776e3bcb..6717b15e798c 100644
--- a/include/linux/panic.h
+++ b/include/linux/panic.h
@@ -32,6 +32,9 @@ extern int sysctl_panic_on_stackoverflow;
extern bool crash_kexec_post_notifiers;
+extern void __stack_chk_fail(void);
+void abort(void);
+
/*
* panic_cpu is used for synchronizing panic() and crash_kexec() execution. It
* holds a CPU number which is executing panic() currently. A value of
--
2.39.2
next prev parent reply other threads:[~2023-05-17 13:19 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-17 13:10 [PATCH 00/14] mm/init/kernel: missing-prototypes warnings Arnd Bergmann
2023-05-17 13:10 ` [PATCH 01/14] mm: percpu: unhide pcpu_embed_first_chunk prototype Arnd Bergmann
2023-05-17 13:10 ` [PATCH 02/14] mm: page_poison: always declare __kernel_map_pages() function Arnd Bergmann
2023-05-17 13:10 ` [PATCH 03/14] mm: sparse: mark populate_section_memmap() static Arnd Bergmann
2023-05-17 13:10 ` [PATCH 04/14] audit: avoid missing-prototype warnings Arnd Bergmann
2023-05-17 14:33 ` [PATCH 4/14] " Paul Moore
2023-05-17 14:51 ` Arnd Bergmann
2023-05-17 15:51 ` Paul Moore
2023-05-17 13:10 ` [PATCH 05/14] lib: devmem_is_allowed: include linux/io.h Arnd Bergmann
2023-05-17 13:10 ` [PATCH 06/14] locking: add lockevent_read() prototype Arnd Bergmann
2023-05-17 13:10 ` [PATCH 07/14] panic: hide unused global functions Arnd Bergmann
2023-05-17 13:10 ` Arnd Bergmann [this message]
2023-05-17 13:10 ` [PATCH 09/14] kunit: include debugfs header file Arnd Bergmann
2023-05-18 3:54 ` David Gow
2023-05-17 13:10 ` [PATCH 10/14] suspend: add a arch_resume_nosmt() prototype Arnd Bergmann
2023-05-17 13:48 ` Rafael J. Wysocki
2023-05-17 14:52 ` Arnd Bergmann
2023-05-24 17:33 ` Rafael J. Wysocki
2023-05-17 13:10 ` [PATCH 11/14] init: consolidate prototypes in linux/init.h Arnd Bergmann
2023-06-22 15:02 ` Palmer Dabbelt
2023-05-17 13:11 ` [PATCH 12/14] init: move cifs_root_data() prototype into linux/mount.h Arnd Bergmann
2023-05-17 13:11 ` [PATCH 13/14] thread_info: move function declarations to linux/thread_info.h Arnd Bergmann
2023-05-24 18:48 ` Catalin Marinas
2023-05-17 13:11 ` [PATCH 14/14] time_namespace: always provide arch_get_vdso_data() prototype for vdso Arnd Bergmann
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=20230517131102.934196-9-arnd@kernel.org \
--to=arnd@kernel$(echo .)org \
--cc=akpm@linux-foundation$(echo .)org \
--cc=arnd@arndb$(echo .)de \
--cc=audit@vger$(echo .)kernel.org \
--cc=boqun.feng@gmail$(echo .)com \
--cc=catalin.marinas@arm$(echo .)com \
--cc=cl@linux$(echo .)com \
--cc=deller@gmx$(echo .)de \
--cc=dennis@kernel$(echo .)org \
--cc=eparis@redhat$(echo .)com \
--cc=hca@linux$(echo .)ibm.com \
--cc=kunit-dev@googlegroups$(echo .)com \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linux-kselftest@vger$(echo .)kernel.org \
--cc=linux-mips@vger$(echo .)kernel.org \
--cc=linux-mm@kvack$(echo .)org \
--cc=linux-parisc@vger$(echo .)kernel.org \
--cc=linux-pm@vger$(echo .)kernel.org \
--cc=linux-riscv@lists$(echo .)infradead.org \
--cc=linux-s390@vger$(echo .)kernel.org \
--cc=linux-sh@vger$(echo .)kernel.org \
--cc=linux@armlinux$(echo .)org.uk \
--cc=linuxppc-dev@lists$(echo .)ozlabs.org \
--cc=longman@redhat$(echo .)com \
--cc=mingo@redhat$(echo .)com \
--cc=monstr@monstr$(echo .)eu \
--cc=palmer@dabbelt$(echo .)com \
--cc=paul@paul-moore$(echo .)com \
--cc=pavel@ucw$(echo .)cz \
--cc=peterz@infradead$(echo .)org \
--cc=rafael@kernel$(echo .)org \
--cc=tglx@linutronix$(echo .)de \
--cc=tj@kernel$(echo .)org \
--cc=tsbogend@alpha$(echo .)franken.de \
--cc=will@kernel$(echo .)org \
--cc=x86@kernel$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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