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]
Date: Wed, 26 Jun 2024 07:19:10 -0400
From: "Zi Yan" <ziy@...dia.com>
To: "ran xiaokai" <ranxiaokai627@....com>
Cc: <yang.yang29@....com.cn>, <si.hao@....com.cn>,
 <akpm@...ux-foundation.org>, <baohua@...nel.org>,
 <linux-fsdevel@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
 <linux-mm@...ck.org>, <peterx@...hat.com>, <ran.xiaokai@....com.cn>,
 <ryan.roberts@....com>, <svetly.todorov@...verge.com>, <vbabka@...e.cz>,
 <willy@...radead.org>
Subject: Re: [PATCH 1/2] mm: Constify
 folio_order()/folio_test_pmd_mappable()

On Wed Jun 26, 2024 at 12:30 AM EDT, ran xiaokai wrote:
> > On Tue Jun 25, 2024 at 10:49 PM EDT, ran xiaokai wrote:
> > > From: Ran Xiaokai <ran.xiaokai@....com.cn>
> > >
> > > Constify folio_order()/folio_test_pmd_mappable().
> > > No functional changes, just a preparation for the next patch.
> > 
> > What warning/error are you seeing when you just apply patch 2? I wonder why it
> > did not show up in other places. Thanks.
>
> fs/proc/page.c: In function 'stable_page_flags':
> fs/proc/page.c:152:35: warning: passing argument 1 of 'folio_test_pmd_mappable' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
>   152 |  else if (folio_test_pmd_mappable(folio)) {
>       |                                   ^~~~~
> In file included from include/linux/mm.h:1115,
>                  from include/linux/memblock.h:12,
>                  from fs/proc/page.c:2:
> include/linux/huge_mm.h:380:58: note: expected 'struct folio *' but argument is of type 'const struct folio *'
>   380 | static inline bool folio_test_pmd_mappable(struct folio *folio)
>
> u64 stable_page_flags(const struct page *page)
> {
> 	const struct folio *folio; // the const definition causes the warning
> 	...

Please include the warning in the commit log to explain the change.

> }
>
> As almost all the folio_test_XXX(flags) have converted to received
> a const parameter, it is Ok to also do this for folio_order()?

Yes.


Download attachment "signature.asc" of type "application/pgp-signature" (855 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ