All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stafford Horne <shorne@gmail.com>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Stafford Horne <shorne@gmail.com>, Arnd Bergmann <arnd@arndb.de>,
	Jonas Bonn <jonas@southpole.se>,
	Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Guo Ren <guoren@kernel.org>,
	Kefeng Wang <wangkefeng.wang@huawei.com>,
	Frederic Weisbecker <frederic@kernel.org>,
	"Gautham R. Shenoy" <gautham.shenoy@amd.com>,
	Peter Zijlstra <peterz@infradead.org>,
	linux-openrisc@vger.kernel.org
Subject: [PATCH 3/8] openrisc: Add prototype for show_registers to processor.h
Date: Mon, 21 Aug 2023 08:20:02 +0100	[thread overview]
Message-ID: <20230821072007.2698186-4-shorne@gmail.com> (raw)
In-Reply-To: <20230821072007.2698186-1-shorne@gmail.com>

When compiling with W=1 enabling -Wmissing-prototypes the compiler
warns:

  arch/openrisc/kernel/traps.c:67:6: error: no previous prototype for 'show_registers' [-Werror=missing-prototypes]

Fix by adding the prototype to the appropriate header file and including
the header file in the appropriate C files.

Reported-by: Arnd Bergmann <arnd@arndb.de>
Closes: https://lore.kernel.org/linux-kernel/20230810141947.1236730-17-arnd@kernel.org/
Signed-off-by: Stafford Horne <shorne@gmail.com>
---
 arch/openrisc/include/asm/processor.h | 1 +
 arch/openrisc/kernel/process.c        | 2 --
 arch/openrisc/kernel/traps.c          | 1 +
 3 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/openrisc/include/asm/processor.h b/arch/openrisc/include/asm/processor.h
index ed9efb430afa..3b736e74e6ed 100644
--- a/arch/openrisc/include/asm/processor.h
+++ b/arch/openrisc/include/asm/processor.h
@@ -73,6 +73,7 @@ struct thread_struct {
 
 void start_thread(struct pt_regs *regs, unsigned long nip, unsigned long sp);
 unsigned long __get_wchan(struct task_struct *p);
+void show_registers(struct pt_regs *regs);
 
 #define cpu_relax()     barrier()
 
diff --git a/arch/openrisc/kernel/process.c b/arch/openrisc/kernel/process.c
index dfa558f98ed8..a07512de0169 100644
--- a/arch/openrisc/kernel/process.c
+++ b/arch/openrisc/kernel/process.c
@@ -119,8 +119,6 @@ void flush_thread(void)
 
 void show_regs(struct pt_regs *regs)
 {
-	extern void show_registers(struct pt_regs *regs);
-
 	show_regs_print_info(KERN_DEFAULT);
 	/* __PHX__ cleanup this mess */
 	show_registers(regs);
diff --git a/arch/openrisc/kernel/traps.c b/arch/openrisc/kernel/traps.c
index afa47501118f..f221e4b4298f 100644
--- a/arch/openrisc/kernel/traps.c
+++ b/arch/openrisc/kernel/traps.c
@@ -31,6 +31,7 @@
 #include <linux/uaccess.h>
 
 #include <asm/io.h>
+#include <asm/processor.h>
 #include <asm/unwinder.h>
 #include <asm/sections.h>
 
-- 
2.39.1


  parent reply	other threads:[~2023-08-21  7:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-21  7:19 [PATCH 0/8] OpenRISC compiler warning fixes Stafford Horne
2023-08-21  7:20 ` [PATCH 1/8] openrisc: Add missing prototypes for assembly called fnctions Stafford Horne
2023-08-21  7:20 ` [PATCH 2/8] openrisc: Declare do_signal function as static Stafford Horne
2023-08-21  7:20 ` Stafford Horne [this message]
2023-08-21  7:20 ` [PATCH 4/8] openrisc: Add prototype for die to bug.h Stafford Horne
2023-08-21  7:20 ` [PATCH 5/8] openrisc: Include cpu.h and switch_to.h for prototypes Stafford Horne
2023-08-21  7:20 ` [PATCH 6/8] openriac: Remove unused nommu_dump_state function Stafford Horne
2023-08-21  7:20 ` [PATCH 7/8] openrisc: Remove unused tlb_init function Stafford Horne
2023-08-21  7:20 ` [PATCH 8/8] openrisc: Remove kernel-doc marker from ioremap comment Stafford Horne

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=20230821072007.2698186-4-shorne@gmail.com \
    --to=shorne@gmail.com \
    --cc=arnd@arndb.de \
    --cc=catalin.marinas@arm.com \
    --cc=frederic@kernel.org \
    --cc=gautham.shenoy@amd.com \
    --cc=geert@linux-m68k.org \
    --cc=guoren@kernel.org \
    --cc=jonas@southpole.se \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-openrisc@vger.kernel.org \
    --cc=mpe@ellerman.id.au \
    --cc=peterz@infradead.org \
    --cc=stefan.kristiansson@saunalahti.fi \
    --cc=wangkefeng.wang@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.