lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <081a7335-ec84-4e26-9ea2-251e3fc42277@redhat.com>
Date: Mon, 1 Sep 2025 16:06:57 +0200
From: David Hildenbrand <david@...hat.com>
To: Max Kellermann <max.kellermann@...os.com>, akpm@...ux-foundation.org,
 axelrasmussen@...gle.com, yuanchu@...gle.com, willy@...radead.org,
 hughd@...gle.com, mhocko@...e.com, linux-kernel@...r.kernel.org,
 linux-mm@...ck.org, lorenzo.stoakes@...cle.com, Liam.Howlett@...cle.com,
 vbabka@...e.cz, rppt@...nel.org, surenb@...gle.com, vishal.moola@...il.com,
 linux@...linux.org.uk, James.Bottomley@...senPartnership.com, deller@....de,
 agordeev@...ux.ibm.com, gerald.schaefer@...ux.ibm.com, hca@...ux.ibm.com,
 gor@...ux.ibm.com, borntraeger@...ux.ibm.com, svens@...ux.ibm.com,
 davem@...emloft.net, andreas@...sler.com, dave.hansen@...ux.intel.com,
 luto@...nel.org, peterz@...radead.org, tglx@...utronix.de, mingo@...hat.com,
 bp@...en8.de, x86@...nel.org, hpa@...or.com, chris@...kel.net,
 jcmvbkbc@...il.com, viro@...iv.linux.org.uk, brauner@...nel.org,
 jack@...e.cz, weixugc@...gle.com, baolin.wang@...ux.alibaba.com,
 rientjes@...gle.com, shakeel.butt@...ux.dev, thuth@...hat.com,
 broonie@...nel.org, osalvador@...e.de, jfalempe@...hat.com,
 mpe@...erman.id.au, nysal@...ux.ibm.com,
 linux-arm-kernel@...ts.infradead.org, linux-parisc@...r.kernel.org,
 linux-s390@...r.kernel.org, sparclinux@...r.kernel.org,
 linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH v5 11/12] mm: constify assert/test functions in mm.h

On 01.09.25 14:30, Max Kellermann wrote:
> For improved const-correctness.
> 
> We select certain assert and test functions which either invoke each
> other, functions that are already const-ified, or no further
> functions.
> 
> It is therefore relatively trivial to const-ify them, which
> provides a basis for further const-ification further up the call
> stack.
> 
> Signed-off-by: Max Kellermann <max.kellermann@...os.com>
> ---
>   include/linux/mm.h | 40 ++++++++++++++++++++--------------------
>   1 file changed, 20 insertions(+), 20 deletions(-)
> 
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index 23864c3519d6..4cca66ba8839 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -703,7 +703,7 @@ static inline void release_fault_lock(struct vm_fault *vmf)
>   		mmap_read_unlock(vmf->vma->vm_mm);
>   }
>   
> -static inline void assert_fault_locked(struct vm_fault *vmf)
> +static inline void assert_fault_locked(struct vm_fault *const vmf)
>   {
>   	if (vmf->flags & FAULT_FLAG_VMA_LOCK)
>   		vma_assert_locked(vmf->vma);
> @@ -716,7 +716,7 @@ static inline void release_fault_lock(struct vm_fault *vmf)
>   	mmap_read_unlock(vmf->vma->vm_mm);
>   }
>   
> -static inline void assert_fault_locked(struct vm_fault *vmf)
> +static inline void assert_fault_locked(const struct vm_fault *vmf)
>   {

This confused me a bit: in the upper variant it's "*const" and here it's 
"const *".

There are multiple such cases here, which might imply that it is not 
"relatively trivial to const-ify them". :)

Did you miss to convert some of these cases properly, or is there a 
reason for this inconsistency?

-- 
Cheers

David / dhildenb


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ