Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6261183rdb; Thu, 14 Dec 2023 12:55:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IH33RGq/jZECncovdKhT341OyIAYp6e62CaboHD2oGEKLoIGLJTaE/vNPjmCMBnkjnOKIRd X-Received: by 2002:a2e:92c4:0:b0:2c9:f288:cb15 with SMTP id k4-20020a2e92c4000000b002c9f288cb15mr5273902ljh.63.1702587334423; Thu, 14 Dec 2023 12:55:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702587334; cv=none; d=google.com; s=arc-20160816; b=HoU54m81EyGdcibIc0I55uLHL7sMEavqHYIa6n64oB/AeHeKkY1uL4xFWecab7Bmg2 fKs7A8vxeQgEaal3X0HJ6GTWnBSxsZTjvBVgAAmzcfqvjWVojrMP/fpdzS/D/QNK3uwR /0G1/iss2wnYIsBMzAl5phwEPNSDuPSWJ/hmoQI9ZQ/c1TC4kkLRxTdqVyNTBGnNDWJW b/QJ9VX8oN794f+mg/LAy2JZ3ZtLZpAmamd9O8TjFhJPn4gOVhQYib6ZHQ6mnwTUE6/v ORJTlYHjErEHdkLWf9TAxUkrbjLneFU6A862bGIcXFGhnQbmQnwshoctzV2iLxXxNgXa WqRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=wxExk1LgDiQQ+6EwBn/tlnGLR2DpqnsBwz6etW4gKZY=; fh=ja6VstOGfu3dNdxYL9ZMUNZ2jTnV8Yuul+3Qd8uvMI4=; b=UWjOnn2j3weIE+boAkzxXs2Qscegb/1PFuAgpI5Rb2kkW6nPysHKSdq5kQMggKpzFm uTMdsQI1fDThZ5ckK1ABM+DlmZhwcKLdj93z1wNFHDpFH89UYGMCGl5QWXOI937zFbuW xJb+CXU3WzAkQY8rZC9L7l1BNNLclzRysOAs3zFXxS1dWKXAhgQicm7z7Bzt0DyxCnbx ZhGsW9tLh7WARQDF058Jv5vYzp0ICqUP7/oTMdMVVdS0bXhzjRyMgM467C0n1PZh69+u 9t2Nv6dhkd4QawW+r9oYW1fY4lYVbTSFGMHH9KjHgAqFdbGBdmbQJu2yOOcyfx0Vfux7 bMVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eaHAZekm; spf=pass (google.com: domain of linux-kernel+bounces-97-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-97-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id ck11-20020a0564021c0b00b0055286c31ea6si471647edb.337.2023.12.14.12.55.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 12:55:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-97-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eaHAZekm; spf=pass (google.com: domain of linux-kernel+bounces-97-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-97-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 2D6561F21783 for ; Thu, 14 Dec 2023 20:55:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 89549697B6; Thu, 14 Dec 2023 20:55:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="eaHAZekm" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 96A026E5A5; Thu, 14 Dec 2023 20:55:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0499BC433C8; Thu, 14 Dec 2023 20:55:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702587326; bh=sO1yA3MRFf7NVPe6oN00hj9uMaVI9YFdkLzhks1q7xs=; h=From:To:Cc:Subject:Date:From; b=eaHAZekmu/N5erIKFfGzhRDNO5t75fWETQ9YjN8yvzstAhL0Sqyi8dqcn7TknLe6a tMhh+Cw9ZSufkdTJeRJvFDrGpIX5CUR3WU6fFZQmPOpZm0N/E6snMfj4/gcmU03APc FOC3WJZxv7dQb7aMCWWm+rQs+rosQQ/6tsjx0wJzNGbcuV2t+N1egYm0eJIDr+IBxO 4t1r3LtLB6S25UU3CdzQZtie4f4BHV8ssLi4/VgP18muqnGCqqUI2utkFnWuBTuM4+ Ovf4DtpUfdlR4jor2kxIVRKU4vKjjCrV2B9uCCIZnb5BCcIT+q5hk+76gwXgT8njqP EnIRgEnAWiK3w== From: Arnd Bergmann To: Andrew Morton Cc: Arnd Bergmann , "kernelci . org bot" , Thomas Bogendoerfer , Zi Yan , Jiaxun Yang , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] mips: fix r3k_cache_init build regression Date: Thu, 14 Dec 2023 20:54:47 +0000 Message-Id: <20231214205506.310402-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Arnd Bergmann My earlier patch removed __weak function declarations that used to be turned into wild branches by the linker, instead causing a link failure when the called functions are unavailable: mips-linux-ld: arch/mips/mm/cache.o: in function `cpu_cache_init': cache.c:(.text+0x670): undefined reference to `r3k_cache_init' The __weak method seems suboptimal, so rather than putting that back, make the function calls conditional on the Kconfig symbol that controls the compilation. Reported-by: kernelci.org bot Fixes: 66445677f01e ("mips: move cache declarations into header") Signed-off-by: Arnd Bergmann --- My broken patch is currently in linux-mm, so the fix should be applied on top. --- arch/mips/mm/cache.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/mips/mm/cache.c b/arch/mips/mm/cache.c index e5d19f4a38ba..b7ce73fba998 100644 --- a/arch/mips/mm/cache.c +++ b/arch/mips/mm/cache.c @@ -205,14 +205,14 @@ static inline void setup_protection_map(void) void cpu_cache_init(void) { - if (cpu_has_3k_cache) { + if (IS_ENABLED(CONFIG_CPU_R3000) && cpu_has_3k_cache) { r3k_cache_init(); } - if (cpu_has_4k_cache) { + if (IS_ENABLED(CONFIG_CPU_R4K_CACHE_TLB) && cpu_has_4k_cache) { r4k_cache_init(); } - if (cpu_has_octeon_cache) { + if (IS_ENABLED(CONFIG_CPU_CAVIUM_OCTEON) && cpu_has_octeon_cache) { octeon_cache_init(); } -- 2.39.2