linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Candle Sun <candlesea@gmail.com>
To: Jiri Kosina <jikos@kernel.org>
Cc: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>,
	Benjamin Tissoires <benjamin.tissoires@redhat.com>,
	orson.zhai@unisoc.com,
	"open list:HID CORE LAYER" <linux-input@vger.kernel.org>,
	lkml <linux-kernel@vger.kernel.org>,
	Candle Sun <candle.sun@unisoc.com>,
	Nianfu Bai <nianfu.bai@unisoc.com>
Subject: Re: [PATCH v2] HID: core: check whether usage page item is after usage id item
Date: Thu, 10 Oct 2019 11:19:28 +0800	[thread overview]
Message-ID: <CAPnx3XNGBw+SKSFA3DhhHFZZ17f54DMfYjKOcqYTb3N-PWGKpw@mail.gmail.com> (raw)
In-Reply-To: <nycvar.YFH.7.76.1910091958120.13160@cbobk.fhfr.pm>

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

  reply	other threads:[~2019-10-10  3:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-09 12:53 [PATCH v2] HID: core: check whether usage page item is after usage id item Candle Sun
2019-10-09 17:01 ` Nicolas Saenz Julienne
2019-10-09 17:59   ` Jiri Kosina
2019-10-10  3:19     ` Candle Sun [this message]
2019-10-10 12:16       ` Benjamin Tissoires
2019-10-11  2:08         ` Candle Sun
2019-10-10  3:05   ` Candle Sun
2019-10-10  7:42     ` Nicolas Saenz Julienne
2019-10-10 12:24 ` Benjamin Tissoires
2019-10-11  2:38   ` Candle Sun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPnx3XNGBw+SKSFA3DhhHFZZ17f54DMfYjKOcqYTb3N-PWGKpw@mail.gmail.com \
    --to=candlesea@gmail.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=candle.sun@unisoc.com \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nianfu.bai@unisoc.com \
    --cc=nsaenzjulienne@suse.de \
    --cc=orson.zhai@unisoc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).