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] [day] [month] [year] [list]
Message-ID: <ac364fac-4ca7-41a9-86c2-f19388b32ec1@redhat.com>
Date: Mon, 11 Aug 2025 11:14:36 +0200
From: David Hildenbrand <david@...hat.com>
To: Thorsten Blum <thorsten.blum@...ux.dev>
Cc: Matthew Wilcox <willy@...radead.org>, Muchun Song
 <muchun.song@...ux.dev>, Oscar Salvador <osalvador@...e.de>,
 Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm/hugetlb: Use max() to simplify
 hugetlb_vmemmap_optimizable_size()

On 11.08.25 11:08, Thorsten Blum wrote:
> On 11. Aug 2025, at 10:26, David Hildenbrand wrote:
>> On 11.08.25 02:15, Matthew Wilcox wrote:
>>> On Sun, Aug 10, 2025 at 11:47:45PM +0200, Thorsten Blum wrote:
>>>> Use max() to simplify hugetlb_vmemmap_optimizable_size() and improve its
>>>> readability.
>>> That ... isn't clearer.
>>
>> No, it isn't.
> 
> I guess it's personal preference. I'd prefer max(0, x) over a ternary
> operator any time.

if (size > 0)
	return size;
/* Nothing can be optimized out. */
return 0;

-- 
Cheers,

David / dhildenb


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ