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: <CAJj2-QHVC0QW_4X95LLAnM=1g6apH==-OXZu65SVeBj0tSUcBg@mail.gmail.com>
Date: Fri, 29 Aug 2025 15:44:12 -0500
From: Yuanchu Xie <yuanchu@...gle.com>
To: Max Kellermann <max.kellermann@...os.com>
Cc: akpm@...ux-foundation.org, david@...hat.com, axelrasmussen@...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
Subject: Re: [PATCH 01/12] mm/shmem: add `const` to lots of pointer parameters

On Fri, Aug 29, 2025 at 1:32 PM Max Kellermann <max.kellermann@...os.com> wrote:
>
> For improved const-correctness.
>
> Signed-off-by: Max Kellermann <max.kellermann@...os.com>
Reviewed-by: Yuanchu Xie <yuanchu@...gle.com>

> ...
>-bool shmem_mapping(struct address_space *mapping)
>+bool shmem_mapping(const struct address_space *mapping)
>{
>       return mapping->a_ops == &shmem_aops;
>}
>EXPORT_SYMBOL_GPL(shmem_mapping);
The exported symbol is being changed, but this doesn't seem like it
would break anything.

Appreciate the work. On a side note, Andrew previously mentioned[1]
making the actual parameter value const (which is different from
adding the const qualifier to the pointer). Longer function
readability would benefit from that, but it's IMO infeasible to do so
everywhere.

[1] https://lore.kernel.org/lkml/20250827144832.87d2f1692fe61325628710f4@linux-foundation.org/#r
Yuanchu

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ