From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 234EE301012 for ; Mon, 16 Feb 2026 11:05:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771239949; cv=none; b=mU5QGHWVNAAihqqrlFAWp1ehmlKG+RL5IBdlKmkpBSFjo/Q2cIrD04sIu2LdarzHUUviATn/HAoo3nGJKmixVSlBwQF2GFuLd6UAy8M9FSk4+mO1PocElXxE5rKalEVE3CtLQV08+TWa+u+RiS3k947FmCzxeoImART3sQlaNg8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771239949; c=relaxed/simple; bh=nVxaSdTkH6+XkEvXBSzAKnFeR5Vt5/qjQhWUnTRPIuo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=muTqGOof22aMIQn+nuc0QwXtjW2dYAaZTfNt5HkFrzZXRy4SQkVH6UrNL/cB4kzLtnCvHj67871aSW9XcyMD9701NTaRGAt24XsN8ZGE3iTVLaqRczpSsFNiV0C+IXAWzR0hhtS4YagQy2bR6DDY5+TDX0u4CKzuB0DJyc8BeBo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3A887150C; Mon, 16 Feb 2026 03:05:41 -0800 (PST) Received: from [10.164.19.71] (unknown [10.164.19.71]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AC8163F7B4; Mon, 16 Feb 2026 03:05:43 -0800 (PST) Message-ID: Date: Mon, 16 Feb 2026 16:35:40 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] [v3] arm64: hugetlbpage: avoid unused-but-set-parameter warning (gcc-16) To: Arnd Bergmann , 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 References: <20260216105432.2381873-1-arnd@kernel.org> Content-Language: en-US From: Dev Jain In-Reply-To: <20260216105432.2381873-1-arnd@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 16/02/26 4:24 pm, Arnd Bergmann wrote: > 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 used [-Werror=unused-but-set-parameter=] > > 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/pgtable.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 phys) > __pte(__phys_to_pte_val((phys_addr_t)(pfn) << PAGE_SHIFT) | pgprot_val(prot)) > > #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))) > > /* > @@ -1284,6 +1282,13 @@ static inline bool pud_user_accessible_page(pud_t pud, 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)