[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4ce074b4-8f79-4e69-81c1-d6e28239ccf0@redhat.com>
Date: Mon, 1 Sep 2025 17:25:20 +0200
From: David Hildenbrand <david@...hat.com>
To: Max Kellermann <max.kellermann@...os.com>
Cc: 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 17:17, Max Kellermann wrote:
> On Mon, Sep 1, 2025 at 4:07 PM David Hildenbrand <david@...hat.com> wrote:
>>> -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 *".
>
> That was indeed a mistake. Both should be "const*const".
>
>> There are multiple such cases here, which might imply that it is not
>> "relatively trivial to const-ify them". :)
>
> I double-checked this patch and couldn't find any other such mistake.
> Or do you mean the function vs prototype thing on parameter values?
If there is a simple rule (declaration/definition), then it's trivial.
Probably worth spelling out that rule somewhere (unless I missed it).
As raised in the other reply, not sure if we should just keep them in sync.
I'm, not the biggest fan of the *const in general here. I can see why
Andrew suggested it, but only doing that for pointers is a bit weird.
Anyhow, that discussion is likely happening elsewhere, and I don't think
there is real harm when doing it, as long as we are consistent with what
we're doing.
--
Cheers
David / dhildenb
Powered by blists - more mailing lists