Re: [PATCH] gpio: gpio-exar: replace division condition with direct comparison
From: Andy Shevchenko
Date: Mon Nov 18 2024 - 04:24:15 EST
On Fri, Nov 15, 2024 at 06:55:41PM +0530, Suraj Sonawane wrote:
> On 15/11/24 15:06, Andy Shevchenko wrote:
...
> > P.S. I wouldn't like to see similar patches to other GPIO drivers,
> > especially those that use a / 8; a % 8 type of expressions together.
>
> I understand your points about the familiarity of line grouping in GPIO
> hardware and the optimization behavior of compilers for power-of-two
> division. I initially thought this could be a good fix as I have seen
> similar changes before.
It really depends on the use case. In some it's good to update like you
proposed, but GPIO drivers (hardware) are special in this sense.
> Thank you for the feedback—I will keep this in mind
> before submitting such patches in the future.
You're welcome! Feel free to Cc me for review, if in doubts.
--
With Best Regards,
Andy Shevchenko