lkml.org 
[lkml]   [2019]   [Oct]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [PATCH v2] HID: core: check whether usage page item is after usage id item
    On Thu, Oct 10, 2019 at 2:00 AM Jiri Kosina <jikos@kernel.org> wrote:
    >
    > On Wed, 9 Oct 2019, Nicolas Saenz Julienne wrote:
    >
    > > > diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
    > > > index 3eaee2c..3394222 100644
    > > > --- a/drivers/hid/hid-core.c
    > > > +++ b/drivers/hid/hid-core.c
    > > > @@ -35,6 +35,8 @@
    > > >
    > > > #include "hid-ids.h"
    > > >
    > > > +#define GET_COMPLETE_USAGE(page, id) (((page) << 16) + ((id) & 0xffff))
    > >
    > > Not sure I like the macro. I'd rather have the explicit code. That said, lets
    > > see what Benjamin has to say.
    >
    > Not sure about Benjamin :) but I personally would ask for putting it
    > somewhere into hid.h as static inline.
    >
    > And even if it's for some reason insisted on this staying macro, please at
    > least put it as close to the place(s) it's being used as possible, in
    > order to maintain some code sanity.
    >
    > Thanks,
    >
    > --
    > Jiri Kosina
    > SUSE Labs
    >

    Thanks Nicolas and Jiri,
    If macro is not good, I will change it to static function. But the
    funciton is only used in hid-core.c,
    maybe placing it into hid.h is not good?

    Regards,
    Candle

    \
     
     \ /
      Last update: 2019-10-10 05:21    [W:2.395 / U:0.016 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site