Hi Janusz, On Sun, Sep 2, 2018 at 2:01 PM Janusz Krzysztofik <jmkrzy...@gmail.com> wrote: > Most users of get/set array functions iterate consecutive bits of data, > usually a single integer, while processing array of results obtained > from, or building an array of values to be passed to those functions. > Save time wasted on those iterations by changing the functions' API to > accept bitmaps. > > All current users are updated as well. > > More benefits from the change are expected as soon as planned support > for accepting/passing those bitmaps directly from/to respective GPIO > chip callbacks if applicable is implemented. > > Cc: Jonathan Corbet <cor...@lwn.net> > Cc: Miguel Ojeda Sandonis <miguel.ojeda.sando...@gmail.com> > Cc: Geert Uytterhoeven <ge...@linux-m68k.org> > Cc: Sebastien Bourdelin <sebastien.bourde...@savoirfairelinux.com> > Cc: Lukas Wunner <lu...@wunner.de> > Cc: Peter Korsgaard <peter.korsga...@barco.com> > Cc: Peter Rosin <p...@axentia.se> > Cc: Andrew Lunn <and...@lunn.ch> > Cc: Florian Fainelli <f.faine...@gmail.com> > Cc: "David S. Miller" <da...@davemloft.net> > Cc: Rojhalat Ibrahim <i...@rtschenk.de> > Cc: Dominik Brodowski <li...@dominikbrodowski.net> > Cc: Russell King <rmk+ker...@armlinux.org.uk> > Cc: Kishon Vijay Abraham I <kis...@ti.com> > Cc: Tony Lindgren <t...@atomide.com> > Cc: Lars-Peter Clausen <l...@metafoo.de> > Cc: Michael Hennerich <michael.henner...@analog.com> > Cc: Jonathan Cameron <ji...@kernel.org> > Cc: Hartmut Knaack <knaac...@gmx.de> > Cc: Peter Meerwald-Stadler <pme...@pmeerw.net> > Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org> > Cc: Jiri Slaby <jsl...@suse.com> > Cc: Yegor Yefremov <yegorsli...@googlemail.com> > Cc: Uwe Kleine-König <u.kleine-koe...@pengutronix.de> > Signed-off-by: Janusz Krzysztofik <jmkrzy...@gmail.com> > Acked-by: Ulf Hansson <ulf.hans...@linaro.org>
> --- a/drivers/auxdisplay/hd44780.c > +++ b/drivers/auxdisplay/hd44780.c > @@ -62,17 +62,12 @@ static void hd44780_strobe_gpio(struct hd44780 *hd) > /* write to an LCD panel register in 8 bit GPIO mode */ > static void hd44780_write_gpio8(struct hd44780 *hd, u8 val, unsigned int rs) > { > - int values[10]; /* for DATA[0-7], RS, RW */ > - unsigned int i, n; > - > - for (i = 0; i < 8; i++) > - values[PIN_DATA0 + i] = !!(val & BIT(i)); > - values[PIN_CTRL_RS] = rs; > - n = 9; > - if (hd->pins[PIN_CTRL_RW]) { > - values[PIN_CTRL_RW] = 0; > - n++; > - } > + DECLARE_BITMAP(values, 10); /* for DATA[0-7], RS, RW */ > + unsigned int n; > + > + *values = val; Given DECLARE_BITMAP() creates an array, the above line looks a bit funny now. IMHO, either you use unsigned long values; values = val; __assign_bit(8, &values, rs); or DECLARE_BITMAP(values, 10); values[0] = val; __assign_bit(8, values, rs); Nevertheless, for hd44780.c: Reviewed-by: Geert Uytterhoeven <geert+rene...@glider.be> Tested-by: Geert Uytterhoeven <geert+rene...@glider.be> Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds _______________________________________________ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel