[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZYMOH2VFRJ1npR7L@smile.fi.intel.com>
Date: Wed, 20 Dec 2023 17:54:07 +0200
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Hugo Villeneuve <hugo@...ovil.com>
Cc: gregkh@...uxfoundation.org, jirislaby@...nel.org, jringle@...dpoint.com,
kubakici@...pl, phil@...pberrypi.org, bo.svangard@...eddedart.se,
linux-kernel@...r.kernel.org, linux-serial@...r.kernel.org,
Hugo Villeneuve <hvilleneuve@...onoff.com>
Subject: Re: [PATCH 13/18] serial: sc16is7xx: use in_range() for DT
properties bound checks
On Tue, Dec 19, 2023 at 12:18:57PM -0500, Hugo Villeneuve wrote:
> From: Hugo Villeneuve <hvilleneuve@...onoff.com>
>
> Improve code readability and efficiency by using in_range() when checking
> device tree properties bound.
...
> count = device_property_count_u32(dev, "irda-mode-ports");
> - if (count < 0 || count > SC16IS7XX_MAX_PORTS)
> + if (!in_range(count, 0, SC16IS7XX_MAX_PORTS + 1))
> return;
Okay, looking at this, it becomes uglier than initial code,
means my suggestion was not good. Please, drop this patch.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists