[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230610150809.babdc5a7919258f066c8637e@linux-foundation.org>
Date: Sat, 10 Jun 2023 15:08:09 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Lorenzo Stoakes <lstoakes@...il.com>
Cc: David Laight <David.Laight@...lab.com>,
Lu Hongfei <luhongfei@...o.com>,
Uladzislau Rezki <urezki@...il.com>,
Christoph Hellwig <hch@...radead.org>,
"open list:VMALLOC" <linux-mm@...ck.org>,
open list <linux-kernel@...r.kernel.org>,
"opensource.kernel@...o.com" <opensource.kernel@...o.com>
Subject: Re: [PATCH] mm/vmalloc: Replace the ternary conditional operator
with min()
On Sat, 10 Jun 2023 22:06:35 +0100 Lorenzo Stoakes <lstoakes@...il.com> wrote:
> > > OK, as per the pedantic test bot, you'll need to change this to:-
> > >
> > > num = min_t(size_t, remains, PAGE_SIZE);
PAGE_SIZE is a nuisance. It _usually_ creates the need for a
cast:
hp2:/usr/src/linux-6.4-rc4> grep -r "min(.*PAGE_SIZE" . | wc -l
117
hp2:/usr/src/linux-6.4-rc4> grep -r "min_t(.*PAGE_SIZE" . | wc -l
279
Perhaps it should always have been size_t.
I suppose we could do
#define PAGE_SIZE_T (size_t)PAGE_SIZE
And use that where needed. Mainly because I like the name ;)
Powered by blists - more mailing lists