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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <57a80de0-c5f8-4fd9-9b4a-fea97fe6c533@suswa.mountain>
Date: Thu, 17 Jul 2025 22:22:06 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Zi Yan <ziy@...dia.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	David Hildenbrand <david@...hat.com>,
	Antonio Quartulli <antonio@...delbit.com>, linux-mm@...ck.org,
	Hugh Dickins <hughd@...gle.com>,
	Kirill Shutemov <k.shutemov@...il.com>,
	Baolin Wang <baolin.wang@...ux.alibaba.com>,
	"Liam R. Howlett" <Liam.Howlett@...cle.com>,
	Nico Pache <npache@...hat.com>, Ryan Roberts <ryan.roberts@....com>,
	Dev Jain <dev.jain@....com>, Barry Song <baohua@...nel.org>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm/huge_memory: refactor after-split (page) cache code.

On Thu, Jul 17, 2025 at 11:45:13AM -0400, Zi Yan wrote:
> 
> >>
> >> Since we no longer need to make new_folio->index >= end work for anon
> >> folios, can we drop the end = -1 in the if (is_anon) { ... } branch?
> >
> > Sure.
> 
> A second thought on this one. If I remove end = -1, can static analysis
> tools understand that end is not used when a folio is anonymous?
> Probably, I can initialize end to -1 and remove end = -1 in is_anon
> branch.

Smatch says that "if "mapping" is non-NULL then "end" is initialized"
and it doesn't trigger a warning.  I don't know how the other checkers
handle it.

Btw, the only thing you really have to pay attention to is Clang because
we treat build warnings as failure.  You're always free to ignore other
checkers.

regards,
dan carpenter


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ