[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKPOu+_aj3wA14VaZo8_k+ukw0OafsSz_Bxa120SQbYi4SqR7g@mail.gmail.com>
Date: Mon, 1 Sep 2025 16:50:50 +0200
From: Max Kellermann <max.kellermann@...os.com>
To: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
Cc: akpm@...ux-foundation.org, david@...hat.com, axelrasmussen@...gle.com,
yuanchu@...gle.com, willy@...radead.org, hughd@...gle.com, mhocko@...e.com,
linux-kernel@...r.kernel.org, linux-mm@...ck.org, 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 02/12] mm: constify pagemap related test functions for
improved const-correctness
On Mon, Sep 1, 2025 at 4:25 PM Lorenzo Stoakes
<lorenzo.stoakes@...cle.com> wrote:
> 1. (most useful) Const pointer (const <type> *<param>) means that the dereffed
> value is const, so *<param> = <val> or <param>-><field> = <val> are prohibited.
Only this was what my initial patch was about.
> 2. (less useful) We can't modify the actual pointer value either, so
> e.g. <param> = <new param> is prohibited.
This wasn't my idea, it was Andrew Morton's idea, supported by Yuanchu Xie:
https://lore.kernel.org/lkml/CAJj2-QHVC0QW_4X95LLAnM=1g6apH==-OXZu65SVeBj0tSUcBg@mail.gmail.com/
You know that because you participated in the discussion. In that
thread, nobody objected, so I took the time and adjusted all of my
patches.
There is some value, but of course it's very small.
Note that I added the value-level "const" only to the implementation,
never to prototypes, because it would have no effect there.
Powered by blists - more mailing lists