Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2651593rdb; Mon, 4 Dec 2023 03:59:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IFrS/nQ5/zTEMJtqfBWnaH3iHEKtJgJr+hqMTfBKQ7w5Z6dBUgi2IHwvdFklmWOJjlsp68T X-Received: by 2002:a17:90b:1990:b0:286:6cc1:8652 with SMTP id mv16-20020a17090b199000b002866cc18652mr1856914pjb.55.1701691154717; Mon, 04 Dec 2023 03:59:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701691154; cv=none; d=google.com; s=arc-20160816; b=nLOZVweQ/LZLcjjj4axxvUX19L4CxEfdRLtKcIzaSXfq33ibMHGjvIPYiBF2qRQKLw 98xkoJY/EnEIKaHNtX0GMU7dm2SzT30S1cH1QEVu6ZioaqJUxWeuUF21RqdBycux/16W opR+m8pYcsQhOAi7aITVwi+VQRZyYQfXTgNiu/6iZGPnIsQbUTht/0stTiOIh+r4ViMy K0fGlBoyMugNXrovlOjX9LWEK7ZttviQwkOfTRysGly+opqn+EkOsEXNNQdd6D+SBuHF 7/MEFSVoOIm9XytwXrpMEJPceuwLDUM13vGLecOz2oZx5snJVtnkevaPfXYwuz+b0Iar r5cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=UrLNg7JJODF7SedymG2xS9n2uUITrJxiVwxNOpyMMBI=; fh=ZaUu8Qu87y0sWtsc/L1xWJKMgHMvIjP9DS2ujBqzc8w=; b=na2RgbZiXZ6ffODyPM4Ybl9qoEmX1gLUGOw3LE3woM1bCm9T0+1GRPkOTqTeCVNKgM tNe2OVjzaiq1T+7wEe9aWK4O6W7IDWJLsHtvRM0n+ycxLVeSV0QtXB/kvoDpWRFVn+fL Ed2WcQvgykgAIzAO5U9SYs3sUEr8PlRoNHQaGvMcZgG8ky66N7SIVgVHXdn+Zu+QKshL tzB7dVc3h9cZrwc1wf++bnnx0yzs47bdM0WQ0o3u0sQ2kI6P5qIBBBE5bTCOqB+iY98m FYSVSa9t1s1YjCRhJAWNDlEJHu7pdZW8CmfpAzOOvFFxV7Y0UvRynl0/xIimJIiuS5Ts fKCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uSS1hvzZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id jg15-20020a17090326cf00b001d07c56fd79si2546619plb.638.2023.12.04.03.59.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 03:59:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uSS1hvzZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id C8E0B8096596; Mon, 4 Dec 2023 03:59:10 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233157AbjLDL64 (ORCPT + 99 others); Mon, 4 Dec 2023 06:58:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343847AbjLDL60 (ORCPT ); Mon, 4 Dec 2023 06:58:26 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D81C1BCC for ; Mon, 4 Dec 2023 03:57:43 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6CF64C433BD; Mon, 4 Dec 2023 11:57:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701691062; bh=MEw5iEws7HKPgFQpUkltS5C9/vAjpe2nQRf3pDzn5fo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uSS1hvzZm4i02EIQ9K2HWhu2UCDfmYoG+ufH7r0E6aq8OFQKHtwQDjwO+vuLM1fyz WJXn08+guq9RVxGXT0ouuad51aJ5S3sj6Hrvrsf9F3Lmsg60uJa8X7n3ve3YwlUv50 NWu6LUjXOqah1bQddwz1DVikGtXxGzGSp1If1AYRyyB2riLMjEagHSlkH/WM2DIgDG bh7vMQN/U1TZ3dJORH5i6RhHJA/yFDFIlyg7Kz5ofMQfULdgbnfHbOJT5wBZqd380T hRMgmGZkEet9eL4M6AzILuHOW5SJnKjcgFCKRCHma6RTwuWpQ5ykn5SRlbu4bW3y1Q vOGuXMbc/wJoA== From: Arnd Bergmann To: linux-mips@vger.kernel.org Cc: Arnd Bergmann , "Andrew Morton" , "Stephen Rothwell" , "Linux Kernel Mailing List" , "Thomas Bogendoerfer" Subject: [PATCH 12/20] mips: move cache declarations into header Date: Mon, 4 Dec 2023 12:57:02 +0100 Message-Id: <20231204115710.2247097-13-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231204115710.2247097-1-arnd@kernel.org> References: <20231204115710.2247097-1-arnd@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Mon, 04 Dec 2023 03:59:11 -0800 (PST) From: Arnd Bergmann Some of the cache functions are declared only for their callers, e.g. arch/mips/mm/c-r3k.c:28:15: error: no previous prototype for 'r3k_cache_size' [-Werror=missing-prototypes] arch/mips/mm/c-r3k.c:63:15: error: no previous prototype for 'r3k_cache_lsize' [-Werror=missing-prototypes] arch/mips/mm/c-r4k.c:1703:6: error: no previous prototype for 'r4k_cache_init' [-Werror=missing-prototypes] arch/mips/mm/sc-mips.c:255:5: error: no previous prototype for 'mips_sc_init' [-Werror=missing-prototypes] Move all the declarations to asm/cache.h and asm/r4kcache.h where they can be seen by the function definitions. Signed-off-by: Arnd Bergmann --- arch/mips/include/asm/cache.h | 6 ++++++ arch/mips/include/asm/r4kcache.h | 4 ++++ arch/mips/kernel/cpu-probe.c | 1 - arch/mips/kernel/cpu-r3k-probe.c | 1 - arch/mips/mm/c-r4k.c | 4 ---- arch/mips/mm/cache.c | 6 ------ 6 files changed, 10 insertions(+), 12 deletions(-) diff --git a/arch/mips/include/asm/cache.h b/arch/mips/include/asm/cache.h index 3424a7908c0f..8b08db3fb17a 100644 --- a/arch/mips/include/asm/cache.h +++ b/arch/mips/include/asm/cache.h @@ -17,5 +17,11 @@ #define __read_mostly __section(".data..read_mostly") extern void cache_noop(void); +extern void r3k_cache_init(void); +extern unsigned long r3k_cache_size(unsigned long); +extern unsigned long r3k_cache_lsize(unsigned long); +extern void r4k_cache_init(void); +extern void octeon_cache_init(void); +extern void au1x00_fixup_config_od(void); #endif /* _ASM_CACHE_H */ diff --git a/arch/mips/include/asm/r4kcache.h b/arch/mips/include/asm/r4kcache.h index 431a1c9d53fc..da1cd1bbdbc5 100644 --- a/arch/mips/include/asm/r4kcache.h +++ b/arch/mips/include/asm/r4kcache.h @@ -24,6 +24,10 @@ #include #include +extern void r5k_sc_init(void); +extern void rm7k_sc_init(void); +extern int mips_sc_init(void); + extern void (*r4k_blast_dcache)(void); extern void (*r4k_blast_icache)(void); diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c index b406d8bfb15a..de7460c3a72e 100644 --- a/arch/mips/kernel/cpu-probe.c +++ b/arch/mips/kernel/cpu-probe.c @@ -179,7 +179,6 @@ void __init check_bugs32(void) static inline int cpu_has_confreg(void) { #ifdef CONFIG_CPU_R3000 - extern unsigned long r3k_cache_size(unsigned long); unsigned long size1, size2; unsigned long cfg = read_c0_conf(); diff --git a/arch/mips/kernel/cpu-r3k-probe.c b/arch/mips/kernel/cpu-r3k-probe.c index be93469c0e0e..0c826f729f75 100644 --- a/arch/mips/kernel/cpu-r3k-probe.c +++ b/arch/mips/kernel/cpu-r3k-probe.c @@ -42,7 +42,6 @@ void __init check_bugs32(void) static inline int cpu_has_confreg(void) { #ifdef CONFIG_CPU_R3000 - extern unsigned long r3k_cache_size(unsigned long); unsigned long size1, size2; unsigned long cfg = read_c0_conf(); diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c index 0619e5296ff3..b45bf026ee55 100644 --- a/arch/mips/mm/c-r4k.c +++ b/arch/mips/mm/c-r4k.c @@ -1485,10 +1485,6 @@ static void loongson3_sc_init(void) return; } -extern int r5k_sc_init(void); -extern int rm7k_sc_init(void); -extern int mips_sc_init(void); - static void setup_scache(void) { struct cpuinfo_mips *c = ¤t_cpu_data; diff --git a/arch/mips/mm/cache.c b/arch/mips/mm/cache.c index 7f830634dbe7..e5d19f4a38ba 100644 --- a/arch/mips/mm/cache.c +++ b/arch/mips/mm/cache.c @@ -206,19 +206,13 @@ static inline void setup_protection_map(void) void cpu_cache_init(void) { if (cpu_has_3k_cache) { - extern void __weak r3k_cache_init(void); - r3k_cache_init(); } if (cpu_has_4k_cache) { - extern void __weak r4k_cache_init(void); - r4k_cache_init(); } if (cpu_has_octeon_cache) { - extern void __weak octeon_cache_init(void); - octeon_cache_init(); } -- 2.39.2