RE: [RFT PATCH 5/7] gpio: exar: unduplicate address and offset computation

2020-11-02 Thread David Laight
From: Andy Shevchenko > Sent: 02 November 2020 10:59 > > On Mon, Oct 26, 2020 at 4:23 PM Bartosz Golaszewski wrote: > > ... > > > +static unsigned int > > +exar_offset_to_sel_addr(struct exar_gpio_chip *exar_gpio, unsigned int > > offset) > > +{ > > + return (offset + exar_gpio->first_pi

Re: [RFT PATCH 5/7] gpio: exar: unduplicate address and offset computation

2020-11-02 Thread Andy Shevchenko
On Mon, Oct 26, 2020 at 4:23 PM Bartosz Golaszewski wrote: ... > +static unsigned int > +exar_offset_to_sel_addr(struct exar_gpio_chip *exar_gpio, unsigned int > offset) > +{ > + return (offset + exar_gpio->first_pin) / 8 ? EXAR_OFFSET_MPIOSEL_HI > +

Re: [RFT PATCH 5/7] gpio: exar: unduplicate address and offset computation

2020-11-02 Thread Bartosz Golaszewski
On Mon, Oct 26, 2020 at 3:51 PM Andy Shevchenko wrote: > > On Mon, Oct 26, 2020 at 4:23 PM Bartosz Golaszewski wrote: > > > > From: Bartosz Golaszewski > > > > Provide and use helpers for calculating the register address and bit > > offset instead of hand coding it in every function. > > Can you

Re: [RFT PATCH 5/7] gpio: exar: unduplicate address and offset computation

2020-10-26 Thread Andy Shevchenko
On Mon, Oct 26, 2020 at 4:23 PM Bartosz Golaszewski wrote: > > From: Bartosz Golaszewski > > Provide and use helpers for calculating the register address and bit > offset instead of hand coding it in every function. Can you check code generation on x86, for example? Sometimes compilers are eage