]> git.itanic.dy.fi Git - linux-stable/commitdiff
s390/traps: only define is_valid_bugaddr() under CONFIG_GENERIC_BUG
authorNathan Chancellor <nathan@kernel.org>
Fri, 1 Dec 2023 00:22:33 +0000 (17:22 -0700)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 11 Dec 2023 01:21:38 +0000 (17:21 -0800)
When building with -Wmissing-prototypes without CONFIG_GENERIC_BUG, there
is a warning about a missing prototype for is_valid_bugaddr():

  arch/s390/kernel/traps.c:46:5: warning: no previous prototype for 'is_valid_bugaddr' [-Wmissing-prototypes]
     46 | int is_valid_bugaddr(unsigned long addr)
        |     ^~~~~~~~~~~~~~~~

The prototype is only declared with CONFIG_GENERIC_BUG, so only define the
function under the same condition to clear up the warning, which matches
other architectures.

Link: https://lkml.kernel.org/r/20231130-s390-missing-prototypes-v1-2-799d3cf07fb7@kernel.org
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Christian Borntraeger <borntraeger@linux.ibm.com>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Jan Höppner <hoeppner@linux.ibm.com>
Cc: Stefan Haberland <sth@linux.ibm.com>
Cc: Sven Schnelle <svens@linux.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/s390/kernel/traps.c

index 1d2aa448d1031ce516bcf5afdec778e7a911d660..cc3e3a01dfa5088cf2186c8dbac4de9c80b539a1 100644 (file)
@@ -43,10 +43,12 @@ static inline void __user *get_trap_ip(struct pt_regs *regs)
        return (void __user *) (address - (regs->int_code >> 16));
 }
 
+#ifdef CONFIG_GENERIC_BUG
 int is_valid_bugaddr(unsigned long addr)
 {
        return 1;
 }
+#endif
 
 void do_report_trap(struct pt_regs *regs, int si_signo, int si_code, char *str)
 {