* [PATCH] MIPS: init: move externs to header file
@ 2021-01-07 3:06 Yanteng Si
2021-01-07 4:40 ` Huacai Chen
2021-01-07 16:28 ` Thomas Bogendoerfer
0 siblings, 2 replies; 3+ messages in thread
From: Yanteng Si @ 2021-01-07 3:06 UTC (permalink / raw)
To: Huacai Chen
Cc: Thomas Bogendoerfer, Jiaxun Yang, linux-mips, Yanteng Si, Yanteng Si
This commit fixes the following checkpatch warnings:
WARNING: externs should be avoided in .c files
This is a warning for placing declarations in a ".c" file.
This fix removes the declaration in ".c" and adds it to
the common header file.
Signed-off-by: Yanteng Si <siyanteng@loongson.cn>
---
arch/mips/include/asm/traps.h | 1 +
arch/mips/loongson2ef/common/init.c | 1 -
arch/mips/loongson64/init.c | 1 -
arch/mips/mti-malta/malta-init.c | 1 -
arch/mips/pistachio/init.c | 1 -
5 files changed, 1 insertion(+), 4 deletions(-)
diff --git a/arch/mips/include/asm/traps.h b/arch/mips/include/asm/traps.h
index 6a0864bb604d..6aa8f126a43d 100644
--- a/arch/mips/include/asm/traps.h
+++ b/arch/mips/include/asm/traps.h
@@ -24,6 +24,7 @@ extern void (*board_ebase_setup)(void);
extern void (*board_cache_error_setup)(void);
extern int register_nmi_notifier(struct notifier_block *nb);
+extern char except_vec_nmi[];
#define nmi_notifier(fn, pri) \
({ \
diff --git a/arch/mips/loongson2ef/common/init.c b/arch/mips/loongson2ef/common/init.c
index ce3f02f75e2a..1469a03c0953 100644
--- a/arch/mips/loongson2ef/common/init.c
+++ b/arch/mips/loongson2ef/common/init.c
@@ -19,7 +19,6 @@ unsigned long __maybe_unused _loongson_addrwincfg_base;
static void __init mips_nmi_setup(void)
{
void *base;
- extern char except_vec_nmi[];
base = (void *)(CAC_BASE + 0x380);
memcpy(base, except_vec_nmi, 0x80);
diff --git a/arch/mips/loongson64/init.c b/arch/mips/loongson64/init.c
index e13f704bef80..cd8e0e0a6104 100644
--- a/arch/mips/loongson64/init.c
+++ b/arch/mips/loongson64/init.c
@@ -25,7 +25,6 @@ u32 node_id_offset;
static void __init mips_nmi_setup(void)
{
void *base;
- extern char except_vec_nmi[];
base = (void *)(CAC_BASE + 0x380);
memcpy(base, except_vec_nmi, 0x80);
diff --git a/arch/mips/mti-malta/malta-init.c b/arch/mips/mti-malta/malta-init.c
index 893af377aacc..b03cac5fdc02 100644
--- a/arch/mips/mti-malta/malta-init.c
+++ b/arch/mips/mti-malta/malta-init.c
@@ -90,7 +90,6 @@ static void __init console_config(void)
static void __init mips_nmi_setup(void)
{
void *base;
- extern char except_vec_nmi[];
base = cpu_has_veic ?
(void *)(CAC_BASE + 0xa80) :
diff --git a/arch/mips/pistachio/init.c b/arch/mips/pistachio/init.c
index 558995ed6fe8..48bb4ab8839d 100644
--- a/arch/mips/pistachio/init.c
+++ b/arch/mips/pistachio/init.c
@@ -83,7 +83,6 @@ phys_addr_t mips_cdmm_phys_base(void)
static void __init mips_nmi_setup(void)
{
void *base;
- extern char except_vec_nmi[];
base = cpu_has_veic ?
(void *)(CAC_BASE + 0xa80) :
--
2.27.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] MIPS: init: move externs to header file
2021-01-07 3:06 [PATCH] MIPS: init: move externs to header file Yanteng Si
@ 2021-01-07 4:40 ` Huacai Chen
2021-01-07 16:28 ` Thomas Bogendoerfer
1 sibling, 0 replies; 3+ messages in thread
From: Huacai Chen @ 2021-01-07 4:40 UTC (permalink / raw)
To: Yanteng Si; +Cc: Thomas Bogendoerfer, Jiaxun Yang, open list:MIPS, Yanteng Si
Reviewed-by: Huacai Chen <chenhuacai@kernel.org>
On Thu, Jan 7, 2021 at 11:06 AM Yanteng Si <siyanteng@loongson.cn> wrote:
>
> This commit fixes the following checkpatch warnings:
>
> WARNING: externs should be avoided in .c files
>
> This is a warning for placing declarations in a ".c" file.
> This fix removes the declaration in ".c" and adds it to
> the common header file.
>
> Signed-off-by: Yanteng Si <siyanteng@loongson.cn>
> ---
> arch/mips/include/asm/traps.h | 1 +
> arch/mips/loongson2ef/common/init.c | 1 -
> arch/mips/loongson64/init.c | 1 -
> arch/mips/mti-malta/malta-init.c | 1 -
> arch/mips/pistachio/init.c | 1 -
> 5 files changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/arch/mips/include/asm/traps.h b/arch/mips/include/asm/traps.h
> index 6a0864bb604d..6aa8f126a43d 100644
> --- a/arch/mips/include/asm/traps.h
> +++ b/arch/mips/include/asm/traps.h
> @@ -24,6 +24,7 @@ extern void (*board_ebase_setup)(void);
> extern void (*board_cache_error_setup)(void);
>
> extern int register_nmi_notifier(struct notifier_block *nb);
> +extern char except_vec_nmi[];
>
> #define nmi_notifier(fn, pri) \
> ({ \
> diff --git a/arch/mips/loongson2ef/common/init.c b/arch/mips/loongson2ef/common/init.c
> index ce3f02f75e2a..1469a03c0953 100644
> --- a/arch/mips/loongson2ef/common/init.c
> +++ b/arch/mips/loongson2ef/common/init.c
> @@ -19,7 +19,6 @@ unsigned long __maybe_unused _loongson_addrwincfg_base;
> static void __init mips_nmi_setup(void)
> {
> void *base;
> - extern char except_vec_nmi[];
>
> base = (void *)(CAC_BASE + 0x380);
> memcpy(base, except_vec_nmi, 0x80);
> diff --git a/arch/mips/loongson64/init.c b/arch/mips/loongson64/init.c
> index e13f704bef80..cd8e0e0a6104 100644
> --- a/arch/mips/loongson64/init.c
> +++ b/arch/mips/loongson64/init.c
> @@ -25,7 +25,6 @@ u32 node_id_offset;
> static void __init mips_nmi_setup(void)
> {
> void *base;
> - extern char except_vec_nmi[];
>
> base = (void *)(CAC_BASE + 0x380);
> memcpy(base, except_vec_nmi, 0x80);
> diff --git a/arch/mips/mti-malta/malta-init.c b/arch/mips/mti-malta/malta-init.c
> index 893af377aacc..b03cac5fdc02 100644
> --- a/arch/mips/mti-malta/malta-init.c
> +++ b/arch/mips/mti-malta/malta-init.c
> @@ -90,7 +90,6 @@ static void __init console_config(void)
> static void __init mips_nmi_setup(void)
> {
> void *base;
> - extern char except_vec_nmi[];
>
> base = cpu_has_veic ?
> (void *)(CAC_BASE + 0xa80) :
> diff --git a/arch/mips/pistachio/init.c b/arch/mips/pistachio/init.c
> index 558995ed6fe8..48bb4ab8839d 100644
> --- a/arch/mips/pistachio/init.c
> +++ b/arch/mips/pistachio/init.c
> @@ -83,7 +83,6 @@ phys_addr_t mips_cdmm_phys_base(void)
> static void __init mips_nmi_setup(void)
> {
> void *base;
> - extern char except_vec_nmi[];
>
> base = cpu_has_veic ?
> (void *)(CAC_BASE + 0xa80) :
> --
> 2.27.0
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] MIPS: init: move externs to header file
2021-01-07 3:06 [PATCH] MIPS: init: move externs to header file Yanteng Si
2021-01-07 4:40 ` Huacai Chen
@ 2021-01-07 16:28 ` Thomas Bogendoerfer
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Bogendoerfer @ 2021-01-07 16:28 UTC (permalink / raw)
To: Yanteng Si; +Cc: Huacai Chen, Jiaxun Yang, linux-mips, Yanteng Si
On Thu, Jan 07, 2021 at 11:06:45AM +0800, Yanteng Si wrote:
> This commit fixes the following checkpatch warnings:
>
> WARNING: externs should be avoided in .c files
>
> This is a warning for placing declarations in a ".c" file.
> This fix removes the declaration in ".c" and adds it to
> the common header file.
>
> Signed-off-by: Yanteng Si <siyanteng@loongson.cn>
> ---
> arch/mips/include/asm/traps.h | 1 +
> arch/mips/loongson2ef/common/init.c | 1 -
> arch/mips/loongson64/init.c | 1 -
> arch/mips/mti-malta/malta-init.c | 1 -
> arch/mips/pistachio/init.c | 1 -
> 5 files changed, 1 insertion(+), 4 deletions(-)
applied to mips-next.
Thomas.
--
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea. [ RFC1925, 2.3 ]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-01-07 16:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-07 3:06 [PATCH] MIPS: init: move externs to header file Yanteng Si
2021-01-07 4:40 ` Huacai Chen
2021-01-07 16:28 ` Thomas Bogendoerfer
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.