[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=whKAaFmqNBEnY=n8Twnh6AEegHh7OL0YFkNS8b3xVQ-3w@mail.gmail.com>
Date: Sat, 20 Jan 2024 13:33:37 -0800
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: David Laight <David.Laight@...lab.com>
Cc: Stephen Rothwell <sfr@...b.auug.org.au>, Jiri Slaby <jirislaby@...il.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Andrew Morton <akpm@...ux-foundation.org>, "Matthew Wilcox (Oracle)" <willy@...radead.org>,
Christoph Hellwig <hch@...radead.org>, "Jason A. Donenfeld" <Jason@...c4.com>
Subject: Re: [PATCH next v4 0/5] minmax: Relax type checks in min() and max().
[ Going through some pending issues now that I've mostly emptied my pull queue ]
On Wed, 10 Jan 2024 at 14:58, David Laight <David.Laight@...lab.com> wrote:
>
> The first check in __types_ok() can go, the second one (with the '+ 0')
> (added to promote char to int) includes the first one.
That turns out to not be true. An expression like
min(u8, unsigned int)
is fine because the underlying types are compatible.
But the promotion to 'int' makes the first argument be a signed
integer, and is no longer compatible with the second argument.
Linus
Powered by blists - more mailing lists