From: Paul Walmsley <paul.walmsley@sifive.com> To: linux-riscv@lists.infradead.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH v3 1/8] riscv: add prototypes for assembly language functions from entry.S Date: Fri, 18 Oct 2019 01:08:34 -0700 [thread overview] Message-ID: <20191018080841.26712-2-paul.walmsley@sifive.com> (raw) In-Reply-To: <20191018080841.26712-1-paul.walmsley@sifive.com> Add prototypes for assembly language functions defined in entry.S, and include these prototypes into C source files that call those functions. This patch resolves the following warnings from sparse: arch/riscv/kernel/signal.c:32:53: warning: incorrect type in initializer (different address spaces) arch/riscv/kernel/signal.c:45:23: warning: incorrect type in initializer (different address spaces) arch/riscv/kernel/signal.c:59:53: warning: incorrect type in initializer (different address spaces) arch/riscv/kernel/signal.c:69:23: warning: incorrect type in initializer (different address spaces) arch/riscv/kernel/signal.c:89:48: warning: incorrect type in argument 2 (different address spaces) arch/riscv/kernel/signal.c:142:45: warning: incorrect type in argument 2 (different address spaces) arch/riscv/kernel/signal.c:295:17: warning: symbol 'do_notify_resume' was not declared. Should it be static? arch/riscv/kernel/traps.c:91:1: warning: symbol 'do_trap_unknown' was not declared. Should it be static? arch/riscv/kernel/traps.c:93:1: warning: symbol 'do_trap_insn_misaligned' was not declared. Should it be static? arch/riscv/kernel/traps.c:95:1: warning: symbol 'do_trap_insn_fault' was not declared. Should it be static? arch/riscv/kernel/traps.c:97:1: warning: symbol 'do_trap_insn_illegal' was not declared. Should it be static? arch/riscv/kernel/traps.c:99:1: warning: symbol 'do_trap_load_misaligned' was not declared. Should it be static? arch/riscv/kernel/traps.c:101:1: warning: symbol 'do_trap_load_fault' was not declared. Should it be static? arch/riscv/kernel/traps.c:103:1: warning: symbol 'do_trap_store_misaligned' was not declared. Should it be static? arch/riscv/kernel/traps.c:105:1: warning: symbol 'do_trap_store_fault' was not declared. Should it be static? arch/riscv/kernel/traps.c:107:1: warning: symbol 'do_trap_ecall_u' was not declared. Should it be static? arch/riscv/kernel/traps.c:109:1: warning: symbol 'do_trap_ecall_s' was not declared. Should it be static? arch/riscv/kernel/traps.c:111:1: warning: symbol 'do_trap_ecall_m' was not declared. Should it be static? arch/riscv/kernel/traps.c:125:17: warning: symbol 'do_trap_break' was not declared. Should it be static? arch/riscv/kernel/traps.c:163:13: warning: symbol 'trap_init' was not declared. Should it be static? This change should have no functional impact. Signed-off-by: Paul Walmsley <paul.walmsley@sifive.com> --- arch/riscv/kernel/entry.h | 29 +++++++++++++++++++++++++++++ arch/riscv/kernel/signal.c | 2 ++ arch/riscv/kernel/traps.c | 2 ++ 3 files changed, 33 insertions(+) create mode 100644 arch/riscv/kernel/entry.h diff --git a/arch/riscv/kernel/entry.h b/arch/riscv/kernel/entry.h new file mode 100644 index 000000000000..73bfcda993d0 --- /dev/null +++ b/arch/riscv/kernel/entry.h @@ -0,0 +1,29 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (C) 2019 SiFive, Inc. + */ +#ifndef __ASM_ENTRY_H +#define __ASM_ENTRY_H + +#include <linux/linkage.h> +#include <linux/init.h> + +asmlinkage void do_trap_unknown(struct pt_regs *regs); +asmlinkage void do_trap_insn_misaligned(struct pt_regs *regs); +asmlinkage void do_trap_insn_fault(struct pt_regs *regs); +asmlinkage void do_trap_insn_illegal(struct pt_regs *regs); +asmlinkage void do_trap_load_misaligned(struct pt_regs *regs); +asmlinkage void do_trap_load_fault(struct pt_regs *regs); +asmlinkage void do_trap_store_misaligned(struct pt_regs *regs); +asmlinkage void do_trap_store_fault(struct pt_regs *regs); +asmlinkage void do_trap_ecall_u(struct pt_regs *regs); +asmlinkage void do_trap_ecall_s(struct pt_regs *regs); +asmlinkage void do_trap_ecall_m(struct pt_regs *regs); +asmlinkage void do_trap_break(struct pt_regs *regs); + +asmlinkage void do_notify_resume(struct pt_regs *regs, + unsigned long thread_info_flags); + +void __init trap_init(void); + +#endif /* __ASM__H */ diff --git a/arch/riscv/kernel/signal.c b/arch/riscv/kernel/signal.c index b14d7647d800..85c700ad47e9 100644 --- a/arch/riscv/kernel/signal.c +++ b/arch/riscv/kernel/signal.c @@ -17,6 +17,8 @@ #include <asm/switch_to.h> #include <asm/csr.h> +#include "entry.h" + #define DEBUG_SIG 0 struct rt_sigframe { diff --git a/arch/riscv/kernel/traps.c b/arch/riscv/kernel/traps.c index 1ac75f7d0bff..eff679c3b618 100644 --- a/arch/riscv/kernel/traps.c +++ b/arch/riscv/kernel/traps.c @@ -19,6 +19,8 @@ #include <asm/ptrace.h> #include <asm/csr.h> +#include "entry.h" + int show_unhandled_signals = 1; extern asmlinkage void handle_exception(void); -- 2.23.0
WARNING: multiple messages have this Message-ID (diff)
From: Paul Walmsley <paul.walmsley@sifive.com> To: linux-riscv@lists.infradead.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH v3 1/8] riscv: add prototypes for assembly language functions from entry.S Date: Fri, 18 Oct 2019 01:08:34 -0700 [thread overview] Message-ID: <20191018080841.26712-2-paul.walmsley@sifive.com> (raw) In-Reply-To: <20191018080841.26712-1-paul.walmsley@sifive.com> Add prototypes for assembly language functions defined in entry.S, and include these prototypes into C source files that call those functions. This patch resolves the following warnings from sparse: arch/riscv/kernel/signal.c:32:53: warning: incorrect type in initializer (different address spaces) arch/riscv/kernel/signal.c:45:23: warning: incorrect type in initializer (different address spaces) arch/riscv/kernel/signal.c:59:53: warning: incorrect type in initializer (different address spaces) arch/riscv/kernel/signal.c:69:23: warning: incorrect type in initializer (different address spaces) arch/riscv/kernel/signal.c:89:48: warning: incorrect type in argument 2 (different address spaces) arch/riscv/kernel/signal.c:142:45: warning: incorrect type in argument 2 (different address spaces) arch/riscv/kernel/signal.c:295:17: warning: symbol 'do_notify_resume' was not declared. Should it be static? arch/riscv/kernel/traps.c:91:1: warning: symbol 'do_trap_unknown' was not declared. Should it be static? arch/riscv/kernel/traps.c:93:1: warning: symbol 'do_trap_insn_misaligned' was not declared. Should it be static? arch/riscv/kernel/traps.c:95:1: warning: symbol 'do_trap_insn_fault' was not declared. Should it be static? arch/riscv/kernel/traps.c:97:1: warning: symbol 'do_trap_insn_illegal' was not declared. Should it be static? arch/riscv/kernel/traps.c:99:1: warning: symbol 'do_trap_load_misaligned' was not declared. Should it be static? arch/riscv/kernel/traps.c:101:1: warning: symbol 'do_trap_load_fault' was not declared. Should it be static? arch/riscv/kernel/traps.c:103:1: warning: symbol 'do_trap_store_misaligned' was not declared. Should it be static? arch/riscv/kernel/traps.c:105:1: warning: symbol 'do_trap_store_fault' was not declared. Should it be static? arch/riscv/kernel/traps.c:107:1: warning: symbol 'do_trap_ecall_u' was not declared. Should it be static? arch/riscv/kernel/traps.c:109:1: warning: symbol 'do_trap_ecall_s' was not declared. Should it be static? arch/riscv/kernel/traps.c:111:1: warning: symbol 'do_trap_ecall_m' was not declared. Should it be static? arch/riscv/kernel/traps.c:125:17: warning: symbol 'do_trap_break' was not declared. Should it be static? arch/riscv/kernel/traps.c:163:13: warning: symbol 'trap_init' was not declared. Should it be static? This change should have no functional impact. Signed-off-by: Paul Walmsley <paul.walmsley@sifive.com> --- arch/riscv/kernel/entry.h | 29 +++++++++++++++++++++++++++++ arch/riscv/kernel/signal.c | 2 ++ arch/riscv/kernel/traps.c | 2 ++ 3 files changed, 33 insertions(+) create mode 100644 arch/riscv/kernel/entry.h diff --git a/arch/riscv/kernel/entry.h b/arch/riscv/kernel/entry.h new file mode 100644 index 000000000000..73bfcda993d0 --- /dev/null +++ b/arch/riscv/kernel/entry.h @@ -0,0 +1,29 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (C) 2019 SiFive, Inc. + */ +#ifndef __ASM_ENTRY_H +#define __ASM_ENTRY_H + +#include <linux/linkage.h> +#include <linux/init.h> + +asmlinkage void do_trap_unknown(struct pt_regs *regs); +asmlinkage void do_trap_insn_misaligned(struct pt_regs *regs); +asmlinkage void do_trap_insn_fault(struct pt_regs *regs); +asmlinkage void do_trap_insn_illegal(struct pt_regs *regs); +asmlinkage void do_trap_load_misaligned(struct pt_regs *regs); +asmlinkage void do_trap_load_fault(struct pt_regs *regs); +asmlinkage void do_trap_store_misaligned(struct pt_regs *regs); +asmlinkage void do_trap_store_fault(struct pt_regs *regs); +asmlinkage void do_trap_ecall_u(struct pt_regs *regs); +asmlinkage void do_trap_ecall_s(struct pt_regs *regs); +asmlinkage void do_trap_ecall_m(struct pt_regs *regs); +asmlinkage void do_trap_break(struct pt_regs *regs); + +asmlinkage void do_notify_resume(struct pt_regs *regs, + unsigned long thread_info_flags); + +void __init trap_init(void); + +#endif /* __ASM__H */ diff --git a/arch/riscv/kernel/signal.c b/arch/riscv/kernel/signal.c index b14d7647d800..85c700ad47e9 100644 --- a/arch/riscv/kernel/signal.c +++ b/arch/riscv/kernel/signal.c @@ -17,6 +17,8 @@ #include <asm/switch_to.h> #include <asm/csr.h> +#include "entry.h" + #define DEBUG_SIG 0 struct rt_sigframe { diff --git a/arch/riscv/kernel/traps.c b/arch/riscv/kernel/traps.c index 1ac75f7d0bff..eff679c3b618 100644 --- a/arch/riscv/kernel/traps.c +++ b/arch/riscv/kernel/traps.c @@ -19,6 +19,8 @@ #include <asm/ptrace.h> #include <asm/csr.h> +#include "entry.h" + int show_unhandled_signals = 1; extern asmlinkage void handle_exception(void); -- 2.23.0 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv
next prev parent reply other threads:[~2019-10-18 8:08 UTC|newest] Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-10-18 8:08 [PATCH v3 0/8] riscv: resolve most warnings from sparse Paul Walmsley 2019-10-18 8:08 ` Paul Walmsley 2019-10-18 8:08 ` Paul Walmsley [this message] 2019-10-18 8:08 ` [PATCH v3 1/8] riscv: add prototypes for assembly language functions from entry.S Paul Walmsley 2019-10-18 15:49 ` Christoph Hellwig 2019-10-18 15:49 ` Christoph Hellwig 2019-10-24 23:59 ` Paul Walmsley 2019-10-24 23:59 ` Paul Walmsley 2019-10-18 8:08 ` [PATCH v3 2/8] riscv: add prototypes for assembly language functions from head.S Paul Walmsley 2019-10-18 8:08 ` Paul Walmsley 2019-10-18 8:08 ` [PATCH v3 3/8] riscv: init: merge split string literals in preprocessor directive Paul Walmsley 2019-10-18 8:08 ` Paul Walmsley 2019-10-18 15:50 ` Christoph Hellwig 2019-10-18 15:50 ` Christoph Hellwig 2019-10-18 8:08 ` [PATCH v3 4/8] riscv: add missing prototypes Paul Walmsley 2019-10-18 8:08 ` Paul Walmsley 2019-10-18 15:54 ` Christoph Hellwig 2019-10-18 15:54 ` Christoph Hellwig 2019-10-18 8:08 ` [PATCH v3 5/8] riscv: mark some code and data as file-static Paul Walmsley 2019-10-18 8:08 ` Paul Walmsley 2019-10-18 15:55 ` Christoph Hellwig 2019-10-18 15:55 ` Christoph Hellwig 2019-10-23 5:46 ` Greentime Hu 2019-10-23 5:46 ` Greentime Hu 2019-10-23 22:32 ` Paul Walmsley 2019-10-23 22:32 ` Paul Walmsley 2019-10-18 8:08 ` [PATCH v3 6/8] riscv: add missing header file includes Paul Walmsley 2019-10-18 8:08 ` Paul Walmsley 2019-10-18 15:55 ` Christoph Hellwig 2019-10-18 15:55 ` Christoph Hellwig 2019-10-18 8:08 ` [PATCH v3 7/8] riscv: fp: add missing __user pointer annotations Paul Walmsley 2019-10-18 8:08 ` Paul Walmsley 2019-10-18 15:56 ` Christoph Hellwig 2019-10-18 15:56 ` Christoph Hellwig 2019-10-18 8:08 ` [PATCH v3 8/8] riscv: for C functions called only from assembly, mark with __visible Paul Walmsley 2019-10-18 8:08 ` Paul Walmsley 2019-10-18 15:56 ` Christoph Hellwig 2019-10-18 15:56 ` Christoph Hellwig
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=20191018080841.26712-2-paul.walmsley@sifive.com \ --to=paul.walmsley@sifive.com \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-riscv@lists.infradead.org \ /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: linkBe 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.