[PATCH v4 4/4] Input: charlieplex_keypad: add GPIO charlieplex keypad
Andy Shevchenko
andriy.shevchenko at intel.com
Tue Mar 10 12:18:25 PDT 2026
On Tue, Mar 10, 2026 at 06:37:34PM +0000, Dmitry Torokhov wrote:
> On Fri, Mar 06, 2026 at 04:21:09PM +0200, Andy Shevchenko wrote:
> > On Thu, Mar 05, 2026 at 02:20:50PM -0500, Hugo Villeneuve wrote:
...
> > > + int oline;
> >
> > Why signed?
> >
> > > + int code;
> > > +
> > > + for (code = 0, oline = 0; oline < keypad->nlines; oline++) {
> >
> > Can be like
> >
> > code = 0;
> > for (unsigned int oline = 0; oline < keypad->nlines; oline++) {
> >
> > as iterator is not used outside the loop.
> >
> > > + DECLARE_BITMAP(values, MATRIX_MAX_ROWS);
> >
> > > + int iline;
> >
> > Why signed?
>
> Does it make any difference given practical limits on nlines?
Maybe not, but might lead to interesting bugs in the future in case if used in
some arithmetics.
--
With Best Regards,
Andy Shevchenko
More information about the Linux-mediatek
mailing list