[PATCH evtest 2/9] Define SYN_MAX instead of a hardcoded value

Peter Hutterer peter.hutterer at who-t.net
Thu Aug 22 16:19:23 PDT 2013


On Thu, Aug 22, 2013 at 11:48:04AM +0200, David Herrmann wrote:
> Hi
> 
> On Thu, Aug 22, 2013 at 5:46 AM, Peter Hutterer
> <peter.hutterer at who-t.net> wrote:
> > This is a bump from the previous one since current kernels have SYN_DROPPED
> > of 3 - might as well update to this value.
> >
> > Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
> 
> Looks good:
> Reviewed-by: David Herrmann <dh.herrmann at gmail.com>
> 
> Any reason this is not available upstream? I think I will send a patch
> to Dmitry. In this case we should add a #ifdef SYN_MAX guard around
> this, though.

added the ifdef guard locally, thanks. no reason this isn't upstream. I
think I did write that mini-patch once but must've never sent it to the
list. go for it.

Cheers,
   Peter

> > ---
> >  evtest.c | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/evtest.c b/evtest.c
> > index af8ff98..43b5169 100644
> > --- a/evtest.c
> > +++ b/evtest.c
> > @@ -69,6 +69,8 @@
> >  #ifndef EV_SYN
> >  #define EV_SYN 0
> >  #endif
> > +#define SYN_MAX 3
> > +#define SYN_CNT (SYN_MAX + 1)
> >  #ifndef SYN_MT_REPORT
> >  #define SYN_MT_REPORT 2
> >  #endif
> > @@ -525,7 +527,8 @@ static const char * const sounds[SND_MAX + 1] = {
> >         NAME_ELEMENT(SND_TONE)
> >  };
> >
> > -static const char * const syns[3] = {
> > +static const char * const syns[SYN_MAX + 1] = {
> > +       [0 ... SYN_MAX] = NULL,
> >         NAME_ELEMENT(SYN_REPORT),
> >         NAME_ELEMENT(SYN_CONFIG),
> >         NAME_ELEMENT(SYN_MT_REPORT)
> > --
> > 1.8.2.1
> >
> > _______________________________________________
> > Input-tools mailing list
> > Input-tools at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/input-tools


More information about the Input-tools mailing list