Re: [PATCH 06/10] gpio: mockup: refuse to accept an odd number of GPIO ranges

From: Andy Shevchenko
Date: Sat May 27 2017 - 13:29:55 EST


On Thu, May 25, 2017 at 11:33 AM, Bartosz Golaszewski <brgl@xxxxxxxx> wrote:
> Currently we ignore the last odd range value, since each chip is
> described by two values. Be more strict and require the user to
> pass an even number of ranges.

> - if (gpio_mockup_params_nr < 2)
> + if (gpio_mockup_params_nr < 2 || (gpio_mockup_params_nr % 2))

if (((gpio_mockup_params_nr + 1) & ~3) < 3)

3 might have a suffix regarding to the type of variable.

--
With Best Regards,
Andy Shevchenko