Skip to contentSkip to conversation

MIPS: init: move externs to header file

PATCH Applied Yanteng Si 3 participants 3 messages Jan 7, 2021

Subsystems (3)
lore
Share & tools
lore

Yanteng Si

author
#0 lore raw

PATCH 1/1 MIPS: init: move externs to header file

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.

---
 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(-)
arch/mips/include/asm/traps.h +1 -0
index 6a0864bb604d..6aa8f126a43d 100644
@@ -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)						\
 ({									\
arch/mips/loongson2ef/common/init.c +0 -1
index ce3f02f75e2a..1469a03c0953 100644
@@ -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);
arch/mips/loongson64/init.c +0 -1
index e13f704bef80..cd8e0e0a6104 100644
@@ -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);
arch/mips/mti-malta/malta-init.c +0 -1
index 893af377aacc..b03cac5fdc02 100644
@@ -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) :
arch/mips/pistachio/init.c +0 -1
index 558995ed6fe8..48bb4ab8839d 100644
@@ -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) :
Signature · 1 line
2.27.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 81 lines · 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.

---
 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(-)
arch/mips/include/asm/traps.h +1 -0
index 6a0864bb604d..6aa8f126a43d 100644
@@ -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)                                          \
 ({                                                                     \
arch/mips/loongson2ef/common/init.c +0 -1
index ce3f02f75e2a..1469a03c0953 100644
@@ -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);
arch/mips/loongson64/init.c +0 -1
index e13f704bef80..cd8e0e0a6104 100644
@@ -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);
arch/mips/mti-malta/malta-init.c +0 -1
index 893af377aacc..b03cac5fdc02 100644
@@ -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) :
arch/mips/pistachio/init.c +0 -2
index 558995ed6fe8..48bb4ab8839d 100644
@@ -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

maintainer Applied
#2 lore raw
In reply to Yanteng Si
Quoted 8 lines · 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.

Quoted 8 lines
---
 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.

Signature · 2 lines
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]