public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: akpm@linux-foundation.org, hca@linux.ibm.com, gor@linux.ibm.com,
	 agordeev@linux.ibm.com
Cc: borntraeger@linux.ibm.com, svens@linux.ibm.com,
	 linux-s390@vger.kernel.org, patches@lists.linux.dev,
	 Nathan Chancellor <nathan@kernel.org>
Subject: [PATCH 2/2] s390/traps: Only define is_valid_bugaddr() under CONFIG_GENERIC_BUG
Date: Thu, 30 Nov 2023 17:22:33 -0700	[thread overview]
Message-ID: <20231130-s390-missing-prototypes-v1-2-799d3cf07fb7@kernel.org> (raw)
In-Reply-To: <20231130-s390-missing-prototypes-v1-0-799d3cf07fb7@kernel.org>

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.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 arch/s390/kernel/traps.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/s390/kernel/traps.c b/arch/s390/kernel/traps.c
index 1d2aa448d103..cc3e3a01dfa5 100644
--- a/arch/s390/kernel/traps.c
+++ b/arch/s390/kernel/traps.c
@@ -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)
 {

-- 
2.43.0


  parent reply	other threads:[~2023-12-01  0:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-01  0:22 [PATCH 0/2] s390: A couple of fixes for -Wmissing-prototypes Nathan Chancellor
2023-12-01  0:22 ` [PATCH 1/2] s390/dasd: Remove dasd_stats_generic_show() Nathan Chancellor
2023-12-04  7:41   ` Alexander Gordeev
2023-12-04 13:13   ` Stefan Haberland
2023-12-01  0:22 ` Nathan Chancellor [this message]
2023-12-04  9:06   ` [PATCH 2/2] s390/traps: Only define is_valid_bugaddr() under CONFIG_GENERIC_BUG Alexander Gordeev
2023-12-04 16:38     ` Nathan Chancellor
2023-12-05 12:59   ` Alexander Gordeev

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=20231130-s390-missing-prototypes-v1-2-799d3cf07fb7@kernel.org \
    --to=nathan@kernel.org \
    --cc=agordeev@linux.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=borntraeger@linux.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=linux-s390@vger.kernel.org \
    --cc=patches@lists.linux.dev \
    --cc=svens@linux.ibm.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