Re: [PATCH v2 2/3] mm: drop pte_clear_not_present_full()

From: Andrew Morton

Date: Mon Jun 29 2026 - 17:09:05 EST


On Mon, 29 Jun 2026 19:43:53 +0200 "David Hildenbrand (Arm)" <david@xxxxxxxxxx> wrote:

> > So... what's happening here?
>
> "nr_pages" are not modified in the function, so the compile does not complain.
> See below.
>
>
> A private build bot barked at me after v1 for
>
> arm-linux-gnueabi-gcc
> openrisc-allnoconfig
> um-allmodconfig
>
> For example:
>
> https://lore.kernel.org/all/202606121420.Wke8Ipgx-lkp@xxxxxxxxx/
>
> All errors (new ones prefixed by >>):
>
> In file included from include/linux/kasan.h:38,
> from include/linux/slab.h:264,
> from lib/test_bitops.c:12:
> include/linux/pgtable.h: In function 'clear_not_present_full_ptes':
> >> include/linux/pgtable.h:974:31: error: parameter 'addr' set but not used
> [-Werror=unused-but-set-parameter=]
> 974 | unsigned long addr, pte_t *ptep, unsigned int nr, int
> full)
> | ~~~~~~~~~~~~~~^~~~
> cc1: all warnings being treated as errors
>
>
> The problem is that addr is updated (written) in the function but never read.

Oh, OK, thanks. I altered the changelog to read

"To prevent the compiler complaining on some configs about "set but not
used" addr parameter, silence that here."