[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aBTSNsCupbpAscwA@smile.fi.intel.com>
Date: Fri, 2 May 2025 17:09:58 +0300
From: Andy Shevchenko <andriy.shevchenko@...el.com>
To: Mathieu Dubois-Briand <mathieu.dubois-briand@...tlin.com>
Cc: Lee Jones <lee@...nel.org>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Kamel Bouhara <kamel.bouhara@...tlin.com>,
Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <brgl@...ev.pl>,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
Uwe Kleine-König <ukleinek@...nel.org>,
Michael Walle <mwalle@...nel.org>, Mark Brown <broonie@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Danilo Krummrich <dakr@...nel.org>, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-gpio@...r.kernel.org,
linux-input@...r.kernel.org, linux-pwm@...r.kernel.org,
Grégory Clement <gregory.clement@...tlin.com>,
Thomas Petazzoni <thomas.petazzoni@...tlin.com>
Subject: Re: [PATCH v7 10/11] input: misc: Add support for MAX7360 rotary
On Fri, May 02, 2025 at 03:58:04PM +0200, Mathieu Dubois-Briand wrote:
> On Fri May 2, 2025 at 12:52 PM CEST, Andy Shevchenko wrote:
> > On Mon, Apr 28, 2025 at 01:57:28PM +0200, Mathieu Dubois-Briand wrote:
...
> >> + pos = max(0, (int)pos + steps);
> >
> > Please, no castings for min()/max()/clamp(). It diminishes the use of those
> > macros.
>
> Sorry, I'm not sure to get the point. Should I use MIN_T() instead?
Are the second argument is compile-time constant? I don't think so. Hence no
use for MIN*()/MAX*(). First of all, try to answer to the Q: Why is the explicit
casting being used? The second Q: How can it be easily fixed without using _t()
variants of the macros?
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists