From patchwork Thu Jan 7 03:06:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yanteng Si X-Patchwork-Id: 12002757 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BBF50C433DB for ; Thu, 7 Jan 2021 03:07:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 70858221E9 for ; Thu, 7 Jan 2021 03:07:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725789AbhAGDH0 (ORCPT ); Wed, 6 Jan 2021 22:07:26 -0500 Received: from mail.loongson.cn ([114.242.206.163]:41696 "EHLO loongson.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725792AbhAGDHZ (ORCPT ); Wed, 6 Jan 2021 22:07:25 -0500 Received: from localhost.localdomain (unknown [112.20.112.14]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9DxWL67evZfYKAAAA--.1473S2; Thu, 07 Jan 2021 11:06:35 +0800 (CST) From: Yanteng Si To: Huacai Chen Cc: Thomas Bogendoerfer , Jiaxun Yang , linux-mips@vger.kernel.org, Yanteng Si , Yanteng Si Subject: [PATCH] MIPS: init: move externs to header file Date: Thu, 7 Jan 2021 11:06:45 +0800 Message-Id: <20210107030645.1844215-1-siyanteng@loongson.cn> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-CM-T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U= X-CM-SenderInfo: pvl1t0pwhqwqxorr0wxvrqhubq/ Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org 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 Reviewed-by: Huacai Chen --- 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) :