From: David Hildenbrand <david@redhat.com>
To: Thorsten Blum <thorsten.blum@linux.dev>
Cc: Matthew Wilcox <willy@infradead.org>,
Muchun Song <muchun.song@linux.dev>,
Oscar Salvador <osalvador@suse.de>,
Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/hugetlb: Use max() to simplify hugetlb_vmemmap_optimizable_size()
Date: Mon, 11 Aug 2025 11:14:36 +0200 [thread overview]
Message-ID: <ac364fac-4ca7-41a9-86c2-f19388b32ec1@redhat.com> (raw)
In-Reply-To: <C6C36750-2C87-4C2B-B683-9789F55D34C2@linux.dev>
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
prev parent reply other threads:[~2025-08-11 9:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-10 21:47 [PATCH] mm/hugetlb: Use max() to simplify hugetlb_vmemmap_optimizable_size() Thorsten Blum
2025-08-11 0:15 ` Matthew Wilcox
2025-08-11 8:26 ` David Hildenbrand
2025-08-11 9:08 ` Thorsten Blum
2025-08-11 9:14 ` David Hildenbrand [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ac364fac-4ca7-41a9-86c2-f19388b32ec1@redhat.com \
--to=david@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=muchun.song@linux.dev \
--cc=osalvador@suse.de \
--cc=thorsten.blum@linux.dev \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).