* [PATCH 0/9] riscv: misc cleanup
@ 2021-03-05 11:33 ` Nanyong Sun
0 siblings, 0 replies; 24+ messages in thread
From: Nanyong Sun @ 2021-03-05 11:33 UTC (permalink / raw)
To: paul.walmsley, palmer, aou
Cc: linux-riscv, linux-kernel, palmerdabbelt, atish.patra,
wangkefeng.wang, sunnanyong
Fix some compilation warnings,improve code style
Nanyong Sun (9):
riscv: traps: Fix no prototype warnings
riscv: irq: Fix no prototype warning
riscv: sbi: Fix comment of __sbi_set_timer_v01
riscv: ptrace: Fix no prototype warnings
riscv: time: Fix no prototype for time_init
riscv: syscall_table: Reduce W=1 compilation warnings noise
riscv: process: Fix no prototype for show_regs
riscv: ftrace: Use ftrace_get_regs helper
riscv: process: Fix no prototype for arch_dup_task_struct
arch/riscv/include/asm/asm-prototypes.h | 16 ++++++++++++++++
arch/riscv/include/asm/irq.h | 2 ++
arch/riscv/include/asm/processor.h | 1 +
arch/riscv/include/asm/ptrace.h | 5 +++++
arch/riscv/include/asm/timex.h | 2 ++
arch/riscv/kernel/Makefile | 1 +
arch/riscv/kernel/probes/ftrace.c | 16 +++++++++-------
arch/riscv/kernel/process.c | 1 +
arch/riscv/kernel/sbi.c | 2 +-
arch/riscv/kernel/time.c | 1 +
arch/riscv/kernel/traps.c | 1 +
11 files changed, 40 insertions(+), 8 deletions(-)
--
2.25.1
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH 0/9] riscv: misc cleanup
@ 2021-03-05 11:33 ` Nanyong Sun
0 siblings, 0 replies; 24+ messages in thread
From: Nanyong Sun @ 2021-03-05 11:33 UTC (permalink / raw)
To: paul.walmsley, palmer, aou
Cc: linux-riscv, linux-kernel, palmerdabbelt, atish.patra,
wangkefeng.wang, sunnanyong
Fix some compilation warnings,improve code style
Nanyong Sun (9):
riscv: traps: Fix no prototype warnings
riscv: irq: Fix no prototype warning
riscv: sbi: Fix comment of __sbi_set_timer_v01
riscv: ptrace: Fix no prototype warnings
riscv: time: Fix no prototype for time_init
riscv: syscall_table: Reduce W=1 compilation warnings noise
riscv: process: Fix no prototype for show_regs
riscv: ftrace: Use ftrace_get_regs helper
riscv: process: Fix no prototype for arch_dup_task_struct
arch/riscv/include/asm/asm-prototypes.h | 16 ++++++++++++++++
arch/riscv/include/asm/irq.h | 2 ++
arch/riscv/include/asm/processor.h | 1 +
arch/riscv/include/asm/ptrace.h | 5 +++++
arch/riscv/include/asm/timex.h | 2 ++
arch/riscv/kernel/Makefile | 1 +
arch/riscv/kernel/probes/ftrace.c | 16 +++++++++-------
arch/riscv/kernel/process.c | 1 +
arch/riscv/kernel/sbi.c | 2 +-
arch/riscv/kernel/time.c | 1 +
arch/riscv/kernel/traps.c | 1 +
11 files changed, 40 insertions(+), 8 deletions(-)
--
2.25.1
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH 1/9] riscv: traps: Fix no prototype warnings
2021-03-05 11:33 ` Nanyong Sun
@ 2021-03-05 11:33 ` Nanyong Sun
-1 siblings, 0 replies; 24+ messages in thread
From: Nanyong Sun @ 2021-03-05 11:33 UTC (permalink / raw)
To: paul.walmsley, palmer, aou
Cc: linux-riscv, linux-kernel, palmerdabbelt, atish.patra,
wangkefeng.wang, sunnanyong
Fix all W=1 compilation warnings:'no previous prototype for' in arch/riscv/kernel/traps.c:
arch/riscv/kernel/traps.c:96:15: warning: no previous prototype for ‘do_trap_unknown’ [-Wmissing-prototypes]
96 | DO_ERROR_INFO(do_trap_unknown,
| ^~~~~~~~~~~~~~~
arch/riscv/kernel/traps.c:91:27: note: in definition of macro ‘DO_ERROR_INFO’
91 | asmlinkage __visible void name(struct pt_regs *regs) \
| ^~~~
arch/riscv/kernel/traps.c:98:15: warning: no previous prototype for ‘do_trap_insn_misaligned’ [-Wmissing-prototypes]
98 | DO_ERROR_INFO(do_trap_insn_misaligned,
| ^~~~~~~~~~~~~~~~~~~~~~~
arch/riscv/kernel/traps.c:91:27: note: in definition of macro ‘DO_ERROR_INFO’
91 | asmlinkage __visible void name(struct pt_regs *regs) \
| ^~~~
arch/riscv/kernel/traps.c:100:15: warning: no previous prototype for ‘do_trap_insn_fault’ [-Wmissing-prototypes]
...
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Nanyong Sun <sunnanyong@huawei.com>
---
arch/riscv/include/asm/asm-prototypes.h | 16 ++++++++++++++++
arch/riscv/kernel/traps.c | 1 +
2 files changed, 17 insertions(+)
diff --git a/arch/riscv/include/asm/asm-prototypes.h b/arch/riscv/include/asm/asm-prototypes.h
index 27e005fca584..6d81abf5d9f8 100644
--- a/arch/riscv/include/asm/asm-prototypes.h
+++ b/arch/riscv/include/asm/asm-prototypes.h
@@ -9,4 +9,20 @@ long long __lshrti3(long long a, int b);
long long __ashrti3(long long a, int b);
long long __ashlti3(long long a, int b);
+
+#define DECLARE_DO_ERROR_INFO(name) asmlinkage void name(struct pt_regs *regs);
+
+DECLARE_DO_ERROR_INFO(do_trap_unknown)
+DECLARE_DO_ERROR_INFO(do_trap_insn_misaligned)
+DECLARE_DO_ERROR_INFO(do_trap_insn_fault)
+DECLARE_DO_ERROR_INFO(do_trap_insn_illegal)
+DECLARE_DO_ERROR_INFO(do_trap_load_fault)
+DECLARE_DO_ERROR_INFO(do_trap_load_misaligned)
+DECLARE_DO_ERROR_INFO(do_trap_store_misaligned)
+DECLARE_DO_ERROR_INFO(do_trap_store_fault)
+DECLARE_DO_ERROR_INFO(do_trap_ecall_u)
+DECLARE_DO_ERROR_INFO(do_trap_ecall_s)
+DECLARE_DO_ERROR_INFO(do_trap_ecall_m)
+DECLARE_DO_ERROR_INFO(do_trap_break)
+
#endif /* _ASM_RISCV_PROTOTYPES_H */
diff --git a/arch/riscv/kernel/traps.c b/arch/riscv/kernel/traps.c
index 3ed2c23601a0..0879b5df11b9 100644
--- a/arch/riscv/kernel/traps.c
+++ b/arch/riscv/kernel/traps.c
@@ -17,6 +17,7 @@
#include <linux/module.h>
#include <linux/irq.h>
+#include <asm/asm-prototypes.h>
#include <asm/bug.h>
#include <asm/processor.h>
#include <asm/ptrace.h>
--
2.25.1
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 1/9] riscv: traps: Fix no prototype warnings
@ 2021-03-05 11:33 ` Nanyong Sun
0 siblings, 0 replies; 24+ messages in thread
From: Nanyong Sun @ 2021-03-05 11:33 UTC (permalink / raw)
To: paul.walmsley, palmer, aou
Cc: linux-riscv, linux-kernel, palmerdabbelt, atish.patra,
wangkefeng.wang, sunnanyong
Fix all W=1 compilation warnings:'no previous prototype for' in arch/riscv/kernel/traps.c:
arch/riscv/kernel/traps.c:96:15: warning: no previous prototype for ‘do_trap_unknown’ [-Wmissing-prototypes]
96 | DO_ERROR_INFO(do_trap_unknown,
| ^~~~~~~~~~~~~~~
arch/riscv/kernel/traps.c:91:27: note: in definition of macro ‘DO_ERROR_INFO’
91 | asmlinkage __visible void name(struct pt_regs *regs) \
| ^~~~
arch/riscv/kernel/traps.c:98:15: warning: no previous prototype for ‘do_trap_insn_misaligned’ [-Wmissing-prototypes]
98 | DO_ERROR_INFO(do_trap_insn_misaligned,
| ^~~~~~~~~~~~~~~~~~~~~~~
arch/riscv/kernel/traps.c:91:27: note: in definition of macro ‘DO_ERROR_INFO’
91 | asmlinkage __visible void name(struct pt_regs *regs) \
| ^~~~
arch/riscv/kernel/traps.c:100:15: warning: no previous prototype for ‘do_trap_insn_fault’ [-Wmissing-prototypes]
...
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Nanyong Sun <sunnanyong@huawei.com>
---
arch/riscv/include/asm/asm-prototypes.h | 16 ++++++++++++++++
arch/riscv/kernel/traps.c | 1 +
2 files changed, 17 insertions(+)
diff --git a/arch/riscv/include/asm/asm-prototypes.h b/arch/riscv/include/asm/asm-prototypes.h
index 27e005fca584..6d81abf5d9f8 100644
--- a/arch/riscv/include/asm/asm-prototypes.h
+++ b/arch/riscv/include/asm/asm-prototypes.h
@@ -9,4 +9,20 @@ long long __lshrti3(long long a, int b);
long long __ashrti3(long long a, int b);
long long __ashlti3(long long a, int b);
+
+#define DECLARE_DO_ERROR_INFO(name) asmlinkage void name(struct pt_regs *regs);
+
+DECLARE_DO_ERROR_INFO(do_trap_unknown)
+DECLARE_DO_ERROR_INFO(do_trap_insn_misaligned)
+DECLARE_DO_ERROR_INFO(do_trap_insn_fault)
+DECLARE_DO_ERROR_INFO(do_trap_insn_illegal)
+DECLARE_DO_ERROR_INFO(do_trap_load_fault)
+DECLARE_DO_ERROR_INFO(do_trap_load_misaligned)
+DECLARE_DO_ERROR_INFO(do_trap_store_misaligned)
+DECLARE_DO_ERROR_INFO(do_trap_store_fault)
+DECLARE_DO_ERROR_INFO(do_trap_ecall_u)
+DECLARE_DO_ERROR_INFO(do_trap_ecall_s)
+DECLARE_DO_ERROR_INFO(do_trap_ecall_m)
+DECLARE_DO_ERROR_INFO(do_trap_break)
+
#endif /* _ASM_RISCV_PROTOTYPES_H */
diff --git a/arch/riscv/kernel/traps.c b/arch/riscv/kernel/traps.c
index 3ed2c23601a0..0879b5df11b9 100644
--- a/arch/riscv/kernel/traps.c
+++ b/arch/riscv/kernel/traps.c
@@ -17,6 +17,7 @@
#include <linux/module.h>
#include <linux/irq.h>
+#include <asm/asm-prototypes.h>
#include <asm/bug.h>
#include <asm/processor.h>
#include <asm/ptrace.h>
--
2.25.1
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 2/9] riscv: irq: Fix no prototype warning
2021-03-05 11:33 ` Nanyong Sun
@ 2021-03-05 11:33 ` Nanyong Sun
-1 siblings, 0 replies; 24+ messages in thread
From: Nanyong Sun @ 2021-03-05 11:33 UTC (permalink / raw)
To: paul.walmsley, palmer, aou
Cc: linux-riscv, linux-kernel, palmerdabbelt, atish.patra,
wangkefeng.wang, sunnanyong
Fix the following W=1 kernel compilation warning:
arch/riscv/kernel/irq.c:19:13: warning: no previous prototype for ‘init_IRQ’ [-Wmissing-prototypes]
19 | void __init init_IRQ(void)
| ^~~~~~~~
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Nanyong Sun <sunnanyong@huawei.com>
---
arch/riscv/include/asm/irq.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/riscv/include/asm/irq.h b/arch/riscv/include/asm/irq.h
index 9807ad164015..e4c435509983 100644
--- a/arch/riscv/include/asm/irq.h
+++ b/arch/riscv/include/asm/irq.h
@@ -12,4 +12,6 @@
#include <asm-generic/irq.h>
+extern void __init init_IRQ(void);
+
#endif /* _ASM_RISCV_IRQ_H */
--
2.25.1
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 2/9] riscv: irq: Fix no prototype warning
@ 2021-03-05 11:33 ` Nanyong Sun
0 siblings, 0 replies; 24+ messages in thread
From: Nanyong Sun @ 2021-03-05 11:33 UTC (permalink / raw)
To: paul.walmsley, palmer, aou
Cc: linux-riscv, linux-kernel, palmerdabbelt, atish.patra,
wangkefeng.wang, sunnanyong
Fix the following W=1 kernel compilation warning:
arch/riscv/kernel/irq.c:19:13: warning: no previous prototype for ‘init_IRQ’ [-Wmissing-prototypes]
19 | void __init init_IRQ(void)
| ^~~~~~~~
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Nanyong Sun <sunnanyong@huawei.com>
---
arch/riscv/include/asm/irq.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/riscv/include/asm/irq.h b/arch/riscv/include/asm/irq.h
index 9807ad164015..e4c435509983 100644
--- a/arch/riscv/include/asm/irq.h
+++ b/arch/riscv/include/asm/irq.h
@@ -12,4 +12,6 @@
#include <asm-generic/irq.h>
+extern void __init init_IRQ(void);
+
#endif /* _ASM_RISCV_IRQ_H */
--
2.25.1
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 3/9] riscv: sbi: Fix comment of __sbi_set_timer_v01
2021-03-05 11:33 ` Nanyong Sun
@ 2021-03-05 11:33 ` Nanyong Sun
-1 siblings, 0 replies; 24+ messages in thread
From: Nanyong Sun @ 2021-03-05 11:33 UTC (permalink / raw)
To: paul.walmsley, palmer, aou
Cc: linux-riscv, linux-kernel, palmerdabbelt, atish.patra,
wangkefeng.wang, sunnanyong
Fix the comment of __sbi_set_timer_v01, the function name in comment
is missing '__'
Signed-off-by: Nanyong Sun <sunnanyong@huawei.com>
---
arch/riscv/kernel/sbi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/riscv/kernel/sbi.c b/arch/riscv/kernel/sbi.c
index f4a7db3d309e..d3bf756321a5 100644
--- a/arch/riscv/kernel/sbi.c
+++ b/arch/riscv/kernel/sbi.c
@@ -116,7 +116,7 @@ void sbi_clear_ipi(void)
EXPORT_SYMBOL(sbi_clear_ipi);
/**
- * sbi_set_timer_v01() - Program the timer for next timer event.
+ * __sbi_set_timer_v01() - Program the timer for next timer event.
* @stime_value: The value after which next timer event should fire.
*
* Return: None
--
2.25.1
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 3/9] riscv: sbi: Fix comment of __sbi_set_timer_v01
@ 2021-03-05 11:33 ` Nanyong Sun
0 siblings, 0 replies; 24+ messages in thread
From: Nanyong Sun @ 2021-03-05 11:33 UTC (permalink / raw)
To: paul.walmsley, palmer, aou
Cc: linux-riscv, linux-kernel, palmerdabbelt, atish.patra,
wangkefeng.wang, sunnanyong
Fix the comment of __sbi_set_timer_v01, the function name in comment
is missing '__'
Signed-off-by: Nanyong Sun <sunnanyong@huawei.com>
---
arch/riscv/kernel/sbi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/riscv/kernel/sbi.c b/arch/riscv/kernel/sbi.c
index f4a7db3d309e..d3bf756321a5 100644
--- a/arch/riscv/kernel/sbi.c
+++ b/arch/riscv/kernel/sbi.c
@@ -116,7 +116,7 @@ void sbi_clear_ipi(void)
EXPORT_SYMBOL(sbi_clear_ipi);
/**
- * sbi_set_timer_v01() - Program the timer for next timer event.
+ * __sbi_set_timer_v01() - Program the timer for next timer event.
* @stime_value: The value after which next timer event should fire.
*
* Return: None
--
2.25.1
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 4/9] riscv: ptrace: Fix no prototype warnings
2021-03-05 11:33 ` Nanyong Sun
@ 2021-03-05 11:33 ` Nanyong Sun
-1 siblings, 0 replies; 24+ messages in thread
From: Nanyong Sun @ 2021-03-05 11:33 UTC (permalink / raw)
To: paul.walmsley, palmer, aou
Cc: linux-riscv, linux-kernel, palmerdabbelt, atish.patra,
wangkefeng.wang, sunnanyong
Fix the following W=1 kernel compilation warnings:
arch/riscv/kernel/ftrace.c:186:6: warning: no previous prototype for ‘prepare_ftrace_return’ [-Wmissing-prototypes]
186 | void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr,
| ^~~~~~~~~~~~~~~~~~~~~
arch/riscv/kernel/ptrace.c:239:15: warning: no previous prototype for ‘do_syscall_trace_enter’ [-Wmissing-prototypes]
239 | __visible int do_syscall_trace_enter(struct pt_regs *regs)
| ^~~~~~~~~~~~~~~~~~~~~~
arch/riscv/kernel/ptrace.c:262:16: warning: no previous prototype for ‘do_syscall_trace_exit’ [-Wmissing-prototypes]
262 | __visible void do_syscall_trace_exit(struct pt_regs *regs)
| ^~~~~~~~~~~~~~~~~~~~~
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Nanyong Sun <sunnanyong@huawei.com>
---
arch/riscv/include/asm/ptrace.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/riscv/include/asm/ptrace.h b/arch/riscv/include/asm/ptrace.h
index cb4abb639e8d..09ad4e923510 100644
--- a/arch/riscv/include/asm/ptrace.h
+++ b/arch/riscv/include/asm/ptrace.h
@@ -119,6 +119,11 @@ extern int regs_query_register_offset(const char *name);
extern unsigned long regs_get_kernel_stack_nth(struct pt_regs *regs,
unsigned int n);
+void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr,
+ unsigned long frame_pointer);
+int do_syscall_trace_enter(struct pt_regs *regs);
+void do_syscall_trace_exit(struct pt_regs *regs);
+
/**
* regs_get_register() - get register value from its offset
* @regs: pt_regs from which register value is gotten
--
2.25.1
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 4/9] riscv: ptrace: Fix no prototype warnings
@ 2021-03-05 11:33 ` Nanyong Sun
0 siblings, 0 replies; 24+ messages in thread
From: Nanyong Sun @ 2021-03-05 11:33 UTC (permalink / raw)
To: paul.walmsley, palmer, aou
Cc: linux-riscv, linux-kernel, palmerdabbelt, atish.patra,
wangkefeng.wang, sunnanyong
Fix the following W=1 kernel compilation warnings:
arch/riscv/kernel/ftrace.c:186:6: warning: no previous prototype for ‘prepare_ftrace_return’ [-Wmissing-prototypes]
186 | void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr,
| ^~~~~~~~~~~~~~~~~~~~~
arch/riscv/kernel/ptrace.c:239:15: warning: no previous prototype for ‘do_syscall_trace_enter’ [-Wmissing-prototypes]
239 | __visible int do_syscall_trace_enter(struct pt_regs *regs)
| ^~~~~~~~~~~~~~~~~~~~~~
arch/riscv/kernel/ptrace.c:262:16: warning: no previous prototype for ‘do_syscall_trace_exit’ [-Wmissing-prototypes]
262 | __visible void do_syscall_trace_exit(struct pt_regs *regs)
| ^~~~~~~~~~~~~~~~~~~~~
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Nanyong Sun <sunnanyong@huawei.com>
---
arch/riscv/include/asm/ptrace.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/riscv/include/asm/ptrace.h b/arch/riscv/include/asm/ptrace.h
index cb4abb639e8d..09ad4e923510 100644
--- a/arch/riscv/include/asm/ptrace.h
+++ b/arch/riscv/include/asm/ptrace.h
@@ -119,6 +119,11 @@ extern int regs_query_register_offset(const char *name);
extern unsigned long regs_get_kernel_stack_nth(struct pt_regs *regs,
unsigned int n);
+void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr,
+ unsigned long frame_pointer);
+int do_syscall_trace_enter(struct pt_regs *regs);
+void do_syscall_trace_exit(struct pt_regs *regs);
+
/**
* regs_get_register() - get register value from its offset
* @regs: pt_regs from which register value is gotten
--
2.25.1
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 5/9] riscv: time: Fix no prototype for time_init
2021-03-05 11:33 ` Nanyong Sun
@ 2021-03-05 11:33 ` Nanyong Sun
-1 siblings, 0 replies; 24+ messages in thread
From: Nanyong Sun @ 2021-03-05 11:33 UTC (permalink / raw)
To: paul.walmsley, palmer, aou
Cc: linux-riscv, linux-kernel, palmerdabbelt, atish.patra,
wangkefeng.wang, sunnanyong
Fix the following W=1 compilation warning:
arch/riscv/kernel/time.c:16:13: warning: no previous prototype for ‘time_init’ [-Wmissing-prototypes]
16 | void __init time_init(void)
| ^~~~~~~~~
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Nanyong Sun <sunnanyong@huawei.com>
---
arch/riscv/include/asm/timex.h | 2 ++
arch/riscv/kernel/time.c | 1 +
2 files changed, 3 insertions(+)
diff --git a/arch/riscv/include/asm/timex.h b/arch/riscv/include/asm/timex.h
index 81de51e6aa32..507cae273bc6 100644
--- a/arch/riscv/include/asm/timex.h
+++ b/arch/riscv/include/asm/timex.h
@@ -88,4 +88,6 @@ static inline int read_current_timer(unsigned long *timer_val)
return 0;
}
+extern void time_init(void);
+
#endif /* _ASM_RISCV_TIMEX_H */
diff --git a/arch/riscv/kernel/time.c b/arch/riscv/kernel/time.c
index 8a5cf99c0776..1b432264f7ef 100644
--- a/arch/riscv/kernel/time.c
+++ b/arch/riscv/kernel/time.c
@@ -9,6 +9,7 @@
#include <linux/delay.h>
#include <asm/sbi.h>
#include <asm/processor.h>
+#include <asm/timex.h>
unsigned long riscv_timebase;
EXPORT_SYMBOL_GPL(riscv_timebase);
--
2.25.1
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 5/9] riscv: time: Fix no prototype for time_init
@ 2021-03-05 11:33 ` Nanyong Sun
0 siblings, 0 replies; 24+ messages in thread
From: Nanyong Sun @ 2021-03-05 11:33 UTC (permalink / raw)
To: paul.walmsley, palmer, aou
Cc: linux-riscv, linux-kernel, palmerdabbelt, atish.patra,
wangkefeng.wang, sunnanyong
Fix the following W=1 compilation warning:
arch/riscv/kernel/time.c:16:13: warning: no previous prototype for ‘time_init’ [-Wmissing-prototypes]
16 | void __init time_init(void)
| ^~~~~~~~~
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Nanyong Sun <sunnanyong@huawei.com>
---
arch/riscv/include/asm/timex.h | 2 ++
arch/riscv/kernel/time.c | 1 +
2 files changed, 3 insertions(+)
diff --git a/arch/riscv/include/asm/timex.h b/arch/riscv/include/asm/timex.h
index 81de51e6aa32..507cae273bc6 100644
--- a/arch/riscv/include/asm/timex.h
+++ b/arch/riscv/include/asm/timex.h
@@ -88,4 +88,6 @@ static inline int read_current_timer(unsigned long *timer_val)
return 0;
}
+extern void time_init(void);
+
#endif /* _ASM_RISCV_TIMEX_H */
diff --git a/arch/riscv/kernel/time.c b/arch/riscv/kernel/time.c
index 8a5cf99c0776..1b432264f7ef 100644
--- a/arch/riscv/kernel/time.c
+++ b/arch/riscv/kernel/time.c
@@ -9,6 +9,7 @@
#include <linux/delay.h>
#include <asm/sbi.h>
#include <asm/processor.h>
+#include <asm/timex.h>
unsigned long riscv_timebase;
EXPORT_SYMBOL_GPL(riscv_timebase);
--
2.25.1
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 6/9] riscv: syscall_table: Reduce W=1 compilation warnings noise
2021-03-05 11:33 ` Nanyong Sun
@ 2021-03-05 11:33 ` Nanyong Sun
-1 siblings, 0 replies; 24+ messages in thread
From: Nanyong Sun @ 2021-03-05 11:33 UTC (permalink / raw)
To: paul.walmsley, palmer, aou
Cc: linux-riscv, linux-kernel, palmerdabbelt, atish.patra,
wangkefeng.wang, sunnanyong
Building riscv syscall table with W=1 throws the warning as
following pattern:
arch/riscv/kernel/syscall_table.c:14:36: warning: initialized field overwritten [-Woverride-init]
14 | #define __SYSCALL(nr, call) [nr] = (call),
| ^
./include/uapi/asm-generic/unistd.h:29:37: note: in expansion of macro ‘__SYSCALL’
29 | #define __SC_COMP(_nr, _sys, _comp) __SYSCALL(_nr, _sys)
| ^~~~~~~~~
./include/uapi/asm-generic/unistd.h:34:1: note: in expansion of macro ‘__SC_COMP’
34 | __SC_COMP(__NR_io_setup, sys_io_setup, compat_sys_io_setup)
| ^~~~~~~~~
arch/riscv/kernel/syscall_table.c:14:36: note: (near initialization for ‘sys_call_table[0]’)
14 | #define __SYSCALL(nr, call) [nr] = (call),
| ^
./include/uapi/asm-generic/unistd.h:29:37: note: in expansion of macro ‘__SYSCALL’
29 | #define __SC_COMP(_nr, _sys, _comp) __SYSCALL(_nr, _sys)
| ^~~~~~~~~
./include/uapi/asm-generic/unistd.h:34:1: note: in expansion of macro ‘__SC_COMP’
34 | __SC_COMP(__NR_io_setup, sys_io_setup, compat_sys_io_setup)
| ^~~~~~~~~
arch/riscv/kernel/syscall_table.c:14:36: warning: initialized field overwritten [-Woverride-init]
...
Since we intentionally build the syscall tables this way,ignore the warning.
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Nanyong Sun <sunnanyong@huawei.com>
---
arch/riscv/kernel/Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/riscv/kernel/Makefile b/arch/riscv/kernel/Makefile
index 3dc0abde988a..647a47f5484a 100644
--- a/arch/riscv/kernel/Makefile
+++ b/arch/riscv/kernel/Makefile
@@ -8,6 +8,7 @@ CFLAGS_REMOVE_ftrace.o = $(CC_FLAGS_FTRACE)
CFLAGS_REMOVE_patch.o = $(CC_FLAGS_FTRACE)
CFLAGS_REMOVE_sbi.o = $(CC_FLAGS_FTRACE)
endif
+CFLAGS_syscall_table.o += $(call cc-option,-Wno-override-init,)
extra-y += head.o
extra-y += vmlinux.lds
--
2.25.1
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 6/9] riscv: syscall_table: Reduce W=1 compilation warnings noise
@ 2021-03-05 11:33 ` Nanyong Sun
0 siblings, 0 replies; 24+ messages in thread
From: Nanyong Sun @ 2021-03-05 11:33 UTC (permalink / raw)
To: paul.walmsley, palmer, aou
Cc: linux-riscv, linux-kernel, palmerdabbelt, atish.patra,
wangkefeng.wang, sunnanyong
Building riscv syscall table with W=1 throws the warning as
following pattern:
arch/riscv/kernel/syscall_table.c:14:36: warning: initialized field overwritten [-Woverride-init]
14 | #define __SYSCALL(nr, call) [nr] = (call),
| ^
./include/uapi/asm-generic/unistd.h:29:37: note: in expansion of macro ‘__SYSCALL’
29 | #define __SC_COMP(_nr, _sys, _comp) __SYSCALL(_nr, _sys)
| ^~~~~~~~~
./include/uapi/asm-generic/unistd.h:34:1: note: in expansion of macro ‘__SC_COMP’
34 | __SC_COMP(__NR_io_setup, sys_io_setup, compat_sys_io_setup)
| ^~~~~~~~~
arch/riscv/kernel/syscall_table.c:14:36: note: (near initialization for ‘sys_call_table[0]’)
14 | #define __SYSCALL(nr, call) [nr] = (call),
| ^
./include/uapi/asm-generic/unistd.h:29:37: note: in expansion of macro ‘__SYSCALL’
29 | #define __SC_COMP(_nr, _sys, _comp) __SYSCALL(_nr, _sys)
| ^~~~~~~~~
./include/uapi/asm-generic/unistd.h:34:1: note: in expansion of macro ‘__SC_COMP’
34 | __SC_COMP(__NR_io_setup, sys_io_setup, compat_sys_io_setup)
| ^~~~~~~~~
arch/riscv/kernel/syscall_table.c:14:36: warning: initialized field overwritten [-Woverride-init]
...
Since we intentionally build the syscall tables this way,ignore the warning.
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Nanyong Sun <sunnanyong@huawei.com>
---
arch/riscv/kernel/Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/riscv/kernel/Makefile b/arch/riscv/kernel/Makefile
index 3dc0abde988a..647a47f5484a 100644
--- a/arch/riscv/kernel/Makefile
+++ b/arch/riscv/kernel/Makefile
@@ -8,6 +8,7 @@ CFLAGS_REMOVE_ftrace.o = $(CC_FLAGS_FTRACE)
CFLAGS_REMOVE_patch.o = $(CC_FLAGS_FTRACE)
CFLAGS_REMOVE_sbi.o = $(CC_FLAGS_FTRACE)
endif
+CFLAGS_syscall_table.o += $(call cc-option,-Wno-override-init,)
extra-y += head.o
extra-y += vmlinux.lds
--
2.25.1
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 7/9] riscv: process: Fix no prototype for show_regs
2021-03-05 11:33 ` Nanyong Sun
@ 2021-03-05 11:33 ` Nanyong Sun
-1 siblings, 0 replies; 24+ messages in thread
From: Nanyong Sun @ 2021-03-05 11:33 UTC (permalink / raw)
To: paul.walmsley, palmer, aou
Cc: linux-riscv, linux-kernel, palmerdabbelt, atish.patra,
wangkefeng.wang, sunnanyong
Include header file to fix the following W=1 compilation warning:
arch/riscv/kernel/process.c:78:6: warning: no previous prototype for ‘show_regs’ [-Wmissing-prototypes]
78 | void show_regs(struct pt_regs *regs)
| ^~~~~~~~~
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Nanyong Sun <sunnanyong@huawei.com>
---
arch/riscv/kernel/process.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/riscv/kernel/process.c b/arch/riscv/kernel/process.c
index 6f728e731bed..f9cd57c9c67d 100644
--- a/arch/riscv/kernel/process.c
+++ b/arch/riscv/kernel/process.c
@@ -10,6 +10,7 @@
#include <linux/cpu.h>
#include <linux/kernel.h>
#include <linux/sched.h>
+#include <linux/sched/debug.h>
#include <linux/sched/task_stack.h>
#include <linux/tick.h>
#include <linux/ptrace.h>
--
2.25.1
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 7/9] riscv: process: Fix no prototype for show_regs
@ 2021-03-05 11:33 ` Nanyong Sun
0 siblings, 0 replies; 24+ messages in thread
From: Nanyong Sun @ 2021-03-05 11:33 UTC (permalink / raw)
To: paul.walmsley, palmer, aou
Cc: linux-riscv, linux-kernel, palmerdabbelt, atish.patra,
wangkefeng.wang, sunnanyong
Include header file to fix the following W=1 compilation warning:
arch/riscv/kernel/process.c:78:6: warning: no previous prototype for ‘show_regs’ [-Wmissing-prototypes]
78 | void show_regs(struct pt_regs *regs)
| ^~~~~~~~~
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Nanyong Sun <sunnanyong@huawei.com>
---
arch/riscv/kernel/process.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/riscv/kernel/process.c b/arch/riscv/kernel/process.c
index 6f728e731bed..f9cd57c9c67d 100644
--- a/arch/riscv/kernel/process.c
+++ b/arch/riscv/kernel/process.c
@@ -10,6 +10,7 @@
#include <linux/cpu.h>
#include <linux/kernel.h>
#include <linux/sched.h>
+#include <linux/sched/debug.h>
#include <linux/sched/task_stack.h>
#include <linux/tick.h>
#include <linux/ptrace.h>
--
2.25.1
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 8/9] riscv: ftrace: Use ftrace_get_regs helper
2021-03-05 11:33 ` Nanyong Sun
@ 2021-03-05 11:33 ` Nanyong Sun
-1 siblings, 0 replies; 24+ messages in thread
From: Nanyong Sun @ 2021-03-05 11:33 UTC (permalink / raw)
To: paul.walmsley, palmer, aou
Cc: linux-riscv, linux-kernel, palmerdabbelt, atish.patra,
wangkefeng.wang, sunnanyong
Use ftrace_get_regs() helper call to get pt_regs from ftrace_regs struct,
this makes the code simpler.
Signed-off-by: Nanyong Sun <sunnanyong@huawei.com>
---
arch/riscv/kernel/probes/ftrace.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/arch/riscv/kernel/probes/ftrace.c b/arch/riscv/kernel/probes/ftrace.c
index e6372490aa0b..2dfb33fdac74 100644
--- a/arch/riscv/kernel/probes/ftrace.c
+++ b/arch/riscv/kernel/probes/ftrace.c
@@ -4,37 +4,39 @@
/* Ftrace callback handler for kprobes -- called under preepmt disabed */
void kprobe_ftrace_handler(unsigned long ip, unsigned long parent_ip,
- struct ftrace_ops *ops, struct ftrace_regs *regs)
+ struct ftrace_ops *ops, struct ftrace_regs *fregs)
{
struct kprobe *p;
+ struct pt_regs *regs;
struct kprobe_ctlblk *kcb;
p = get_kprobe((kprobe_opcode_t *)ip);
if (unlikely(!p) || kprobe_disabled(p))
return;
+ regs = ftrace_get_regs(fregs);
kcb = get_kprobe_ctlblk();
if (kprobe_running()) {
kprobes_inc_nmissed_count(p);
} else {
- unsigned long orig_ip = instruction_pointer(&(regs->regs));
+ unsigned long orig_ip = instruction_pointer(regs);
- instruction_pointer_set(&(regs->regs), ip);
+ instruction_pointer_set(regs, ip);
__this_cpu_write(current_kprobe, p);
kcb->kprobe_status = KPROBE_HIT_ACTIVE;
- if (!p->pre_handler || !p->pre_handler(p, &(regs->regs))) {
+ if (!p->pre_handler || !p->pre_handler(p, regs)) {
/*
* Emulate singlestep (and also recover regs->pc)
* as if there is a nop
*/
- instruction_pointer_set(&(regs->regs),
+ instruction_pointer_set(regs,
(unsigned long)p->addr + MCOUNT_INSN_SIZE);
if (unlikely(p->post_handler)) {
kcb->kprobe_status = KPROBE_HIT_SSDONE;
- p->post_handler(p, &(regs->regs), 0);
+ p->post_handler(p, regs, 0);
}
- instruction_pointer_set(&(regs->regs), orig_ip);
+ instruction_pointer_set(regs, orig_ip);
}
/*
--
2.25.1
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 8/9] riscv: ftrace: Use ftrace_get_regs helper
@ 2021-03-05 11:33 ` Nanyong Sun
0 siblings, 0 replies; 24+ messages in thread
From: Nanyong Sun @ 2021-03-05 11:33 UTC (permalink / raw)
To: paul.walmsley, palmer, aou
Cc: linux-riscv, linux-kernel, palmerdabbelt, atish.patra,
wangkefeng.wang, sunnanyong
Use ftrace_get_regs() helper call to get pt_regs from ftrace_regs struct,
this makes the code simpler.
Signed-off-by: Nanyong Sun <sunnanyong@huawei.com>
---
arch/riscv/kernel/probes/ftrace.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/arch/riscv/kernel/probes/ftrace.c b/arch/riscv/kernel/probes/ftrace.c
index e6372490aa0b..2dfb33fdac74 100644
--- a/arch/riscv/kernel/probes/ftrace.c
+++ b/arch/riscv/kernel/probes/ftrace.c
@@ -4,37 +4,39 @@
/* Ftrace callback handler for kprobes -- called under preepmt disabed */
void kprobe_ftrace_handler(unsigned long ip, unsigned long parent_ip,
- struct ftrace_ops *ops, struct ftrace_regs *regs)
+ struct ftrace_ops *ops, struct ftrace_regs *fregs)
{
struct kprobe *p;
+ struct pt_regs *regs;
struct kprobe_ctlblk *kcb;
p = get_kprobe((kprobe_opcode_t *)ip);
if (unlikely(!p) || kprobe_disabled(p))
return;
+ regs = ftrace_get_regs(fregs);
kcb = get_kprobe_ctlblk();
if (kprobe_running()) {
kprobes_inc_nmissed_count(p);
} else {
- unsigned long orig_ip = instruction_pointer(&(regs->regs));
+ unsigned long orig_ip = instruction_pointer(regs);
- instruction_pointer_set(&(regs->regs), ip);
+ instruction_pointer_set(regs, ip);
__this_cpu_write(current_kprobe, p);
kcb->kprobe_status = KPROBE_HIT_ACTIVE;
- if (!p->pre_handler || !p->pre_handler(p, &(regs->regs))) {
+ if (!p->pre_handler || !p->pre_handler(p, regs)) {
/*
* Emulate singlestep (and also recover regs->pc)
* as if there is a nop
*/
- instruction_pointer_set(&(regs->regs),
+ instruction_pointer_set(regs,
(unsigned long)p->addr + MCOUNT_INSN_SIZE);
if (unlikely(p->post_handler)) {
kcb->kprobe_status = KPROBE_HIT_SSDONE;
- p->post_handler(p, &(regs->regs), 0);
+ p->post_handler(p, regs, 0);
}
- instruction_pointer_set(&(regs->regs), orig_ip);
+ instruction_pointer_set(regs, orig_ip);
}
/*
--
2.25.1
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 9/9] riscv: process: Fix no prototype for arch_dup_task_struct
2021-03-05 11:33 ` Nanyong Sun
@ 2021-03-05 11:33 ` Nanyong Sun
-1 siblings, 0 replies; 24+ messages in thread
From: Nanyong Sun @ 2021-03-05 11:33 UTC (permalink / raw)
To: paul.walmsley, palmer, aou
Cc: linux-riscv, linux-kernel, palmerdabbelt, atish.patra,
wangkefeng.wang, sunnanyong
Fix the following W=1 compilation warning:
arch/riscv/kernel/process.c:114:5: warning: no previous prototype for ‘arch_dup_task_struct’ [-Wmissing-prototypes]
114 | int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src)
| ^~~~~~~~~~~~~~~~~~~~
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Nanyong Sun <sunnanyong@huawei.com>
---
arch/riscv/include/asm/processor.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/riscv/include/asm/processor.h b/arch/riscv/include/asm/processor.h
index 3a240037bde2..021ed64ee608 100644
--- a/arch/riscv/include/asm/processor.h
+++ b/arch/riscv/include/asm/processor.h
@@ -71,6 +71,7 @@ int riscv_of_processor_hartid(struct device_node *node);
int riscv_of_parent_hartid(struct device_node *node);
extern void riscv_fill_hwcap(void);
+extern int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src);
#endif /* __ASSEMBLY__ */
--
2.25.1
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 9/9] riscv: process: Fix no prototype for arch_dup_task_struct
@ 2021-03-05 11:33 ` Nanyong Sun
0 siblings, 0 replies; 24+ messages in thread
From: Nanyong Sun @ 2021-03-05 11:33 UTC (permalink / raw)
To: paul.walmsley, palmer, aou
Cc: linux-riscv, linux-kernel, palmerdabbelt, atish.patra,
wangkefeng.wang, sunnanyong
Fix the following W=1 compilation warning:
arch/riscv/kernel/process.c:114:5: warning: no previous prototype for ‘arch_dup_task_struct’ [-Wmissing-prototypes]
114 | int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src)
| ^~~~~~~~~~~~~~~~~~~~
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Nanyong Sun <sunnanyong@huawei.com>
---
arch/riscv/include/asm/processor.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/riscv/include/asm/processor.h b/arch/riscv/include/asm/processor.h
index 3a240037bde2..021ed64ee608 100644
--- a/arch/riscv/include/asm/processor.h
+++ b/arch/riscv/include/asm/processor.h
@@ -71,6 +71,7 @@ int riscv_of_processor_hartid(struct device_node *node);
int riscv_of_parent_hartid(struct device_node *node);
extern void riscv_fill_hwcap(void);
+extern int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src);
#endif /* __ASSEMBLY__ */
--
2.25.1
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 24+ messages in thread
* Re: [PATCH 1/9] riscv: traps: Fix no prototype warnings
2021-03-05 11:33 ` Nanyong Sun
@ 2021-03-10 4:47 ` Palmer Dabbelt
-1 siblings, 0 replies; 24+ messages in thread
From: Palmer Dabbelt @ 2021-03-10 4:47 UTC (permalink / raw)
To: sunnanyong
Cc: Paul Walmsley, aou, linux-riscv, linux-kernel, Atish Patra,
wangkefeng.wang, sunnanyong
On Fri, 05 Mar 2021 03:33:24 PST (-0800), sunnanyong@huawei.com wrote:
> Fix all W=1 compilation warnings:'no previous prototype for' in arch/riscv/kernel/traps.c:
> arch/riscv/kernel/traps.c:96:15: warning: no previous prototype for ‘do_trap_unknown’ [-Wmissing-prototypes]
> 96 | DO_ERROR_INFO(do_trap_unknown,
> | ^~~~~~~~~~~~~~~
> arch/riscv/kernel/traps.c:91:27: note: in definition of macro ‘DO_ERROR_INFO’
> 91 | asmlinkage __visible void name(struct pt_regs *regs) \
> | ^~~~
> arch/riscv/kernel/traps.c:98:15: warning: no previous prototype for ‘do_trap_insn_misaligned’ [-Wmissing-prototypes]
> 98 | DO_ERROR_INFO(do_trap_insn_misaligned,
> | ^~~~~~~~~~~~~~~~~~~~~~~
> arch/riscv/kernel/traps.c:91:27: note: in definition of macro ‘DO_ERROR_INFO’
> 91 | asmlinkage __visible void name(struct pt_regs *regs) \
> | ^~~~
> arch/riscv/kernel/traps.c:100:15: warning: no previous prototype for ‘do_trap_insn_fault’ [-Wmissing-prototypes]
> ...
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Nanyong Sun <sunnanyong@huawei.com>
> ---
> arch/riscv/include/asm/asm-prototypes.h | 16 ++++++++++++++++
> arch/riscv/kernel/traps.c | 1 +
> 2 files changed, 17 insertions(+)
>
> diff --git a/arch/riscv/include/asm/asm-prototypes.h b/arch/riscv/include/asm/asm-prototypes.h
> index 27e005fca584..6d81abf5d9f8 100644
> --- a/arch/riscv/include/asm/asm-prototypes.h
> +++ b/arch/riscv/include/asm/asm-prototypes.h
> @@ -9,4 +9,20 @@ long long __lshrti3(long long a, int b);
> long long __ashrti3(long long a, int b);
> long long __ashlti3(long long a, int b);
>
> +
> +#define DECLARE_DO_ERROR_INFO(name) asmlinkage void name(struct pt_regs *regs);
This triggers checkpatch.
> +
> +DECLARE_DO_ERROR_INFO(do_trap_unknown)
> +DECLARE_DO_ERROR_INFO(do_trap_insn_misaligned)
> +DECLARE_DO_ERROR_INFO(do_trap_insn_fault)
> +DECLARE_DO_ERROR_INFO(do_trap_insn_illegal)
> +DECLARE_DO_ERROR_INFO(do_trap_load_fault)
> +DECLARE_DO_ERROR_INFO(do_trap_load_misaligned)
> +DECLARE_DO_ERROR_INFO(do_trap_store_misaligned)
> +DECLARE_DO_ERROR_INFO(do_trap_store_fault)
> +DECLARE_DO_ERROR_INFO(do_trap_ecall_u)
> +DECLARE_DO_ERROR_INFO(do_trap_ecall_s)
> +DECLARE_DO_ERROR_INFO(do_trap_ecall_m)
> +DECLARE_DO_ERROR_INFO(do_trap_break)
> +
> #endif /* _ASM_RISCV_PROTOTYPES_H */
> diff --git a/arch/riscv/kernel/traps.c b/arch/riscv/kernel/traps.c
> index 3ed2c23601a0..0879b5df11b9 100644
> --- a/arch/riscv/kernel/traps.c
> +++ b/arch/riscv/kernel/traps.c
> @@ -17,6 +17,7 @@
> #include <linux/module.h>
> #include <linux/irq.h>
>
> +#include <asm/asm-prototypes.h>
> #include <asm/bug.h>
> #include <asm/processor.h>
> #include <asm/ptrace.h>
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 1/9] riscv: traps: Fix no prototype warnings
@ 2021-03-10 4:47 ` Palmer Dabbelt
0 siblings, 0 replies; 24+ messages in thread
From: Palmer Dabbelt @ 2021-03-10 4:47 UTC (permalink / raw)
To: sunnanyong
Cc: Paul Walmsley, aou, linux-riscv, linux-kernel, Atish Patra,
wangkefeng.wang, sunnanyong
On Fri, 05 Mar 2021 03:33:24 PST (-0800), sunnanyong@huawei.com wrote:
> Fix all W=1 compilation warnings:'no previous prototype for' in arch/riscv/kernel/traps.c:
> arch/riscv/kernel/traps.c:96:15: warning: no previous prototype for ‘do_trap_unknown’ [-Wmissing-prototypes]
> 96 | DO_ERROR_INFO(do_trap_unknown,
> | ^~~~~~~~~~~~~~~
> arch/riscv/kernel/traps.c:91:27: note: in definition of macro ‘DO_ERROR_INFO’
> 91 | asmlinkage __visible void name(struct pt_regs *regs) \
> | ^~~~
> arch/riscv/kernel/traps.c:98:15: warning: no previous prototype for ‘do_trap_insn_misaligned’ [-Wmissing-prototypes]
> 98 | DO_ERROR_INFO(do_trap_insn_misaligned,
> | ^~~~~~~~~~~~~~~~~~~~~~~
> arch/riscv/kernel/traps.c:91:27: note: in definition of macro ‘DO_ERROR_INFO’
> 91 | asmlinkage __visible void name(struct pt_regs *regs) \
> | ^~~~
> arch/riscv/kernel/traps.c:100:15: warning: no previous prototype for ‘do_trap_insn_fault’ [-Wmissing-prototypes]
> ...
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Nanyong Sun <sunnanyong@huawei.com>
> ---
> arch/riscv/include/asm/asm-prototypes.h | 16 ++++++++++++++++
> arch/riscv/kernel/traps.c | 1 +
> 2 files changed, 17 insertions(+)
>
> diff --git a/arch/riscv/include/asm/asm-prototypes.h b/arch/riscv/include/asm/asm-prototypes.h
> index 27e005fca584..6d81abf5d9f8 100644
> --- a/arch/riscv/include/asm/asm-prototypes.h
> +++ b/arch/riscv/include/asm/asm-prototypes.h
> @@ -9,4 +9,20 @@ long long __lshrti3(long long a, int b);
> long long __ashrti3(long long a, int b);
> long long __ashlti3(long long a, int b);
>
> +
> +#define DECLARE_DO_ERROR_INFO(name) asmlinkage void name(struct pt_regs *regs);
This triggers checkpatch.
> +
> +DECLARE_DO_ERROR_INFO(do_trap_unknown)
> +DECLARE_DO_ERROR_INFO(do_trap_insn_misaligned)
> +DECLARE_DO_ERROR_INFO(do_trap_insn_fault)
> +DECLARE_DO_ERROR_INFO(do_trap_insn_illegal)
> +DECLARE_DO_ERROR_INFO(do_trap_load_fault)
> +DECLARE_DO_ERROR_INFO(do_trap_load_misaligned)
> +DECLARE_DO_ERROR_INFO(do_trap_store_misaligned)
> +DECLARE_DO_ERROR_INFO(do_trap_store_fault)
> +DECLARE_DO_ERROR_INFO(do_trap_ecall_u)
> +DECLARE_DO_ERROR_INFO(do_trap_ecall_s)
> +DECLARE_DO_ERROR_INFO(do_trap_ecall_m)
> +DECLARE_DO_ERROR_INFO(do_trap_break)
> +
> #endif /* _ASM_RISCV_PROTOTYPES_H */
> diff --git a/arch/riscv/kernel/traps.c b/arch/riscv/kernel/traps.c
> index 3ed2c23601a0..0879b5df11b9 100644
> --- a/arch/riscv/kernel/traps.c
> +++ b/arch/riscv/kernel/traps.c
> @@ -17,6 +17,7 @@
> #include <linux/module.h>
> #include <linux/irq.h>
>
> +#include <asm/asm-prototypes.h>
> #include <asm/bug.h>
> #include <asm/processor.h>
> #include <asm/ptrace.h>
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 0/9] riscv: misc cleanup
2021-03-05 11:33 ` Nanyong Sun
@ 2021-03-10 4:47 ` Palmer Dabbelt
-1 siblings, 0 replies; 24+ messages in thread
From: Palmer Dabbelt @ 2021-03-10 4:47 UTC (permalink / raw)
To: sunnanyong
Cc: Paul Walmsley, aou, linux-riscv, linux-kernel, Atish Patra,
wangkefeng.wang, sunnanyong
On Fri, 05 Mar 2021 03:33:23 PST (-0800), sunnanyong@huawei.com wrote:
> Fix some compilation warnings,improve code style
>
> Nanyong Sun (9):
> riscv: traps: Fix no prototype warnings
> riscv: irq: Fix no prototype warning
> riscv: sbi: Fix comment of __sbi_set_timer_v01
> riscv: ptrace: Fix no prototype warnings
> riscv: time: Fix no prototype for time_init
> riscv: syscall_table: Reduce W=1 compilation warnings noise
> riscv: process: Fix no prototype for show_regs
> riscv: ftrace: Use ftrace_get_regs helper
> riscv: process: Fix no prototype for arch_dup_task_struct
>
> arch/riscv/include/asm/asm-prototypes.h | 16 ++++++++++++++++
> arch/riscv/include/asm/irq.h | 2 ++
> arch/riscv/include/asm/processor.h | 1 +
> arch/riscv/include/asm/ptrace.h | 5 +++++
> arch/riscv/include/asm/timex.h | 2 ++
> arch/riscv/kernel/Makefile | 1 +
> arch/riscv/kernel/probes/ftrace.c | 16 +++++++++-------
> arch/riscv/kernel/process.c | 1 +
> arch/riscv/kernel/sbi.c | 2 +-
> arch/riscv/kernel/time.c | 1 +
> arch/riscv/kernel/traps.c | 1 +
> 11 files changed, 40 insertions(+), 8 deletions(-)
Thanks. I fixed the checkpatch warning, these are all on fixes.
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 0/9] riscv: misc cleanup
@ 2021-03-10 4:47 ` Palmer Dabbelt
0 siblings, 0 replies; 24+ messages in thread
From: Palmer Dabbelt @ 2021-03-10 4:47 UTC (permalink / raw)
To: sunnanyong
Cc: Paul Walmsley, aou, linux-riscv, linux-kernel, Atish Patra,
wangkefeng.wang, sunnanyong
On Fri, 05 Mar 2021 03:33:23 PST (-0800), sunnanyong@huawei.com wrote:
> Fix some compilation warnings,improve code style
>
> Nanyong Sun (9):
> riscv: traps: Fix no prototype warnings
> riscv: irq: Fix no prototype warning
> riscv: sbi: Fix comment of __sbi_set_timer_v01
> riscv: ptrace: Fix no prototype warnings
> riscv: time: Fix no prototype for time_init
> riscv: syscall_table: Reduce W=1 compilation warnings noise
> riscv: process: Fix no prototype for show_regs
> riscv: ftrace: Use ftrace_get_regs helper
> riscv: process: Fix no prototype for arch_dup_task_struct
>
> arch/riscv/include/asm/asm-prototypes.h | 16 ++++++++++++++++
> arch/riscv/include/asm/irq.h | 2 ++
> arch/riscv/include/asm/processor.h | 1 +
> arch/riscv/include/asm/ptrace.h | 5 +++++
> arch/riscv/include/asm/timex.h | 2 ++
> arch/riscv/kernel/Makefile | 1 +
> arch/riscv/kernel/probes/ftrace.c | 16 +++++++++-------
> arch/riscv/kernel/process.c | 1 +
> arch/riscv/kernel/sbi.c | 2 +-
> arch/riscv/kernel/time.c | 1 +
> arch/riscv/kernel/traps.c | 1 +
> 11 files changed, 40 insertions(+), 8 deletions(-)
Thanks. I fixed the checkpatch warning, these are all on fixes.
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 24+ messages in thread
end of thread, other threads:[~2021-03-10 4:48 UTC | newest]
Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-05 11:33 [PATCH 0/9] riscv: misc cleanup Nanyong Sun
2021-03-05 11:33 ` Nanyong Sun
2021-03-05 11:33 ` [PATCH 1/9] riscv: traps: Fix no prototype warnings Nanyong Sun
2021-03-05 11:33 ` Nanyong Sun
2021-03-10 4:47 ` Palmer Dabbelt
2021-03-10 4:47 ` Palmer Dabbelt
2021-03-05 11:33 ` [PATCH 2/9] riscv: irq: Fix no prototype warning Nanyong Sun
2021-03-05 11:33 ` Nanyong Sun
2021-03-05 11:33 ` [PATCH 3/9] riscv: sbi: Fix comment of __sbi_set_timer_v01 Nanyong Sun
2021-03-05 11:33 ` Nanyong Sun
2021-03-05 11:33 ` [PATCH 4/9] riscv: ptrace: Fix no prototype warnings Nanyong Sun
2021-03-05 11:33 ` Nanyong Sun
2021-03-05 11:33 ` [PATCH 5/9] riscv: time: Fix no prototype for time_init Nanyong Sun
2021-03-05 11:33 ` Nanyong Sun
2021-03-05 11:33 ` [PATCH 6/9] riscv: syscall_table: Reduce W=1 compilation warnings noise Nanyong Sun
2021-03-05 11:33 ` Nanyong Sun
2021-03-05 11:33 ` [PATCH 7/9] riscv: process: Fix no prototype for show_regs Nanyong Sun
2021-03-05 11:33 ` Nanyong Sun
2021-03-05 11:33 ` [PATCH 8/9] riscv: ftrace: Use ftrace_get_regs helper Nanyong Sun
2021-03-05 11:33 ` Nanyong Sun
2021-03-05 11:33 ` [PATCH 9/9] riscv: process: Fix no prototype for arch_dup_task_struct Nanyong Sun
2021-03-05 11:33 ` Nanyong Sun
2021-03-10 4:47 ` [PATCH 0/9] riscv: misc cleanup Palmer Dabbelt
2021-03-10 4:47 ` Palmer Dabbelt
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.