linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
To: Candle Sun <candlesea@gmail.com>
Cc: Jiri Kosina <jikos@kernel.org>,
	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 09:42:45 +0200	[thread overview]
Message-ID: <9c7526b57ca330a686439921a0672d50553f4d2d.camel@suse.de> (raw)
In-Reply-To: <CAPnx3XPDA_n_yjyiAqwX05ee0ez3tUrJz=2tQ95VeiA_dRA-xA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1230 bytes --]

On Thu, 2019-10-10 at 11:05 +0800, Candle Sun wrote:
> > > -static void hid_concatenate_usage_page(struct hid_parser *parser)
> > > +static void hid_concatenate_last_usage_page(struct hid_parser *parser)
> > >  {
> > >       int i;
> > > +     unsigned int usage;
> > > +     unsigned int usage_page = parser->global.usage_page;
> > > +
> > > +     if (!parser->local.usage_page_last)
> > > +             return;
> > > 
> > >       for (i = 0; i < parser->local.usage_index; i++)
> > 
> > Technically correct but it's preferred if you use braces here.
> > 
> 
> Nicolas, do you mean this:
> 
> @@ -563,12 +563,13 @@ static void
> hid_concatenate_last_usage_page(struct hid_parser *parser)
>         if (!parser->local.usage_page_last)
>                 return;
> 
> -       for (i = 0; i < parser->local.usage_index; i++)
> +       for (i = 0; i < parser->local.usage_index; i++) {
>                 if (parser->local.usage_size[i] <= 2) {
>                         usage = parser->local.usage[i];
>                         parser->local.usage[i] =
>                                 GET_COMPLETE_USAGE(usage_page, usage);
>                 }
> +       }
>  }

Yes, thanks!

Regards,
Nicolas


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2019-10-10  7:42 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
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 [this message]
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=9c7526b57ca330a686439921a0672d50553f4d2d.camel@suse.de \
    --to=nsaenzjulienne@suse.de \
    --cc=benjamin.tissoires@redhat.com \
    --cc=candle.sun@unisoc.com \
    --cc=candlesea@gmail.com \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nianfu.bai@unisoc.com \
    --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).