Skip to content

Commit 729a2e8

Browse files
arndbwilldeacon
authored andcommitted
arm64: hugetlbpage: avoid unused-but-set-parameter warning (gcc-16)
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 <catalin.marinas@arm.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Dev Jain <dev.jain@arm.com> Signed-off-by: Will Deacon <will@kernel.org>
1 parent 29cc0f3 commit 729a2e8

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

arch/arm64/include/asm/pgtable.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,6 @@ static inline pteval_t __phys_to_pte_val(phys_addr_t phys)
179179
__pte(__phys_to_pte_val((phys_addr_t)(pfn) << PAGE_SHIFT) | pgprot_val(prot))
180180

181181
#define pte_none(pte) (!pte_val(pte))
182-
#define __pte_clear(mm, addr, ptep) \
183-
__set_pte(ptep, __pte(0))
184182
#define pte_page(pte) (pfn_to_page(pte_pfn(pte)))
185183

186184
/*
@@ -1320,6 +1318,13 @@ static inline bool pud_user_accessible_page(pud_t pud)
13201318
/*
13211319
* Atomic pte/pmd modifications.
13221320
*/
1321+
1322+
static inline void __pte_clear(struct mm_struct *mm,
1323+
unsigned long addr, pte_t *ptep)
1324+
{
1325+
__set_pte(ptep, __pte(0));
1326+
}
1327+
13231328
static inline int __ptep_test_and_clear_young(struct vm_area_struct *vma,
13241329
unsigned long address,
13251330
pte_t *ptep)

0 commit comments

Comments
 (0)