Re: [PATCH] iio: adc: ad4170: use lookup table for gpio mask selection
From: Andy Shevchenko
Date: Mon Apr 06 2026 - 15:51:08 EST
On Sun, Apr 05, 2026 at 06:37:26PM -0300, Guilherme Ivo Bozi wrote:
> Both ad4170_gpio_direction_input() and
> ad4170_gpio_direction_output() duplicate the same switch
> statement to map a GPIO offset to its corresponding mask.
>
> Replace the switch with a static lookup table, simplifying the code
> and avoiding duplication. This also makes future extensions easier.
>
> No functional change intended.
If this churn is okay by maintainers,
Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>
--
With Best Regards,
Andy Shevchenko