From nobody Thu Mar 19 02:05:43 2026 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 6959E3016F7 for ; Mon, 16 Feb 2026 10:54:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771239278; cv=none; b=hCYXWLg3l+W3i/IITBmKTCDJlV4MpUmtYI7R6JE2og16H7i58MnpDJfnNJ+llwIbYGrRwswfwSRzOqp+NqG2jAh+CqncjcvjWVXLS8vYz9mKHAIU0dy8DoUiPWe3lrd3FZr4+BqX2P1Rx5jWtbTtNbFqDrqU6CJmIrH7LTxYixU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771239278; c=relaxed/simple; bh=OcCCo/1gRKB3YHar1Lc1ULAMl9R2PY7ytURVC/zC2sg=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=PVGTEdXYpaPpGFjpwC7ZLR9K4mzMlMgwYvqEuVXBm7cboO2IAGfwGByp6VzqqWSyGbLu1ef6xC4MlTVAso+4vtnLlIg0BVXrHzydBi28aaetZZUaj3lpVEvYJ8Nk6Lo/PNQ//KxElpP7YRFuyX2itfKQiYhqPDantJj15TS6eAY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=R+X5w6GY; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="R+X5w6GY" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5784AC116C6; Mon, 16 Feb 2026 10:54:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771239278; bh=OcCCo/1gRKB3YHar1Lc1ULAMl9R2PY7ytURVC/zC2sg=; h=From:To:Cc:Subject:Date:From; b=R+X5w6GYEGRtaLWwCzk55Gjti+NnLuiEHjJr5f+8arFJw5httlIYr0Cs/5Znih7AC K21j3MdM0wiOa+qnfTLLG2icKmQ1AB7BNy5JkoMEeu85Hn72M2OsSZd1lmq7u0MQ8X NddiN0F5DN20asATZiSMV9cLq5YL5He+sgthp797qbugLkdK08iorKeJPjLVhTpR02 3ZRgOncoyXR92VKcHTfRTeG4y8PgAejqFLktiaPgV+Fp/b5h80qZuB+ULIoUwqjQrG 93sniiQ9g8bhyEmvnUC3wYw9F8OJoWPcg0Zo9fhqux6jmR5su2n+z4n/vfa4SqYXC8 mdOmsXpYw5b1g== From: Arnd Bergmann To: Catalin Marinas , Will Deacon Cc: Arnd Bergmann , Andrew Morton , Ryan Roberts , Anshuman Khandual , Rohan McLure , Kevin Brodsky , Baolin Wang , Alistair Popple , Andrew Donnellan , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] [v3] arm64: hugetlbpage: avoid unused-but-set-parameter warning (gcc-16) Date: Mon, 16 Feb 2026 11:54:21 +0100 Message-Id: <20260216105432.2381873-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.5 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Arnd Bergmann gcc-16 warns about an instance that older compilers did not: arch/arm64/mm/hugetlbpage.c: In function 'huge_pte_clear': arch/arm64/mm/hugetlbpage.c:369:57: error: parameter 'addr' set but not use= d [-Werror=3Dunused-but-set-parameter=3D] The issue here is that __pte_clear() does not actually use its second argument, but when CONFIG_ARM64_CONTPTE is enabled it still gets updated. Replace the macro with an inline function to let the compiler see the argument getting passed down. Suggested-by: Catalin Marinas Signed-off-by: Arnd Bergmann Reviewed-by: Dev Jain --- v3: rephrase changelog text v2: replace my original patch with Catalin's suggestion --- arch/arm64/include/asm/pgtable.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgta= ble.h index a17eb8a76788..b3e58735c49b 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h @@ -144,8 +144,6 @@ static inline pteval_t __phys_to_pte_val(phys_addr_t ph= ys) __pte(__phys_to_pte_val((phys_addr_t)(pfn) << PAGE_SHIFT) | pgprot_val(pr= ot)) =20 #define pte_none(pte) (!pte_val(pte)) -#define __pte_clear(mm, addr, ptep) \ - __set_pte(ptep, __pte(0)) #define pte_page(pte) (pfn_to_page(pte_pfn(pte))) =20 /* @@ -1284,6 +1282,13 @@ static inline bool pud_user_accessible_page(pud_t pu= d, unsigned long addr) /* * Atomic pte/pmd modifications. */ + +static inline void __pte_clear(struct mm_struct *mm, + unsigned long addr, pte_t *ptep) +{ + __set_pte(ptep, __pte(0)); +} + static inline int __ptep_test_and_clear_young(struct vm_area_struct *vma, unsigned long address, pte_t *ptep) --=20 2.39.5