]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
arm64: hugetlbpage: avoid unused-but-set-parameter warning (gcc-16)
authorArnd Bergmann <arnd@arndb.de>
Mon, 16 Feb 2026 10:54:21 +0000 (11:54 +0100)
committerWill Deacon <will@kernel.org>
Thu, 19 Feb 2026 12:33:52 +0000 (12:33 +0000)
commit729a2e8e9ac47099a967567389cc9d73ef4194ca
treefd7043f3068b879f96574a4427c54e9b26527f37
parent29cc0f3aa7c64d3b3cb9d94c0a0984ba6717bf72
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>
arch/arm64/include/asm/pgtable.h