From: Robert Munteanu <rombert@apache.org>
To: John S Gruber <JohnSGruber@gmail.com>,
Jiri Kosina <jikos@kernel.org>,
linux-input@vger.kernel.org, benjamin.tissoires@redhat.com,
dmitry.torokhov@gmail.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] HID: redragon Add additional verification to rdesc modification quirk
Date: Fri, 03 Aug 2018 16:21:56 +0300 [thread overview]
Message-ID: <393a529f40e7d61493178a1baeee5e2679c7da11.camel@apache.org> (raw)
In-Reply-To: <CAPotdmQh_sWqPmiQ=_+fJ27AT7GA5hcne=wsXcmKhNnUpUs3wQ@mail.gmail.com>
On Sat, 2018-07-28 at 15:53 -0400, John S Gruber wrote:
> There are many devices using the vendor_id 0c45 and device_id of 760b
> combination. Also the two bytes 0x81 0x00 aren't rare for a report
> description. For these reasons the report description being altered
> by the quirk should be verified more completely
>
> If I'm understanding this correctly, I believe for an array field the
> report_size should be greater or equal to
> ceil(log2(usage_maximum - usage_minimum + 1)). That's 3 bits for
> these 8
> shift keys, 0xe0-0xe7. Therefore the incorrect report description
> can't
> be valid for any device.
>
> Check the actual count of the rdesc and compare the entire field
> description to reduce the chance of patching the wrong thing by
> inadvertence.
>
> Signed-off-by: John S Gruber <JohnSGruber@gmail.com>
I tested this on 4.17.11 with 85455dd906d5 and cbe7e3ad0eab from Jiri's
for-4.19/upstream tree and it works just fine.
Feel free to add
Acked-By: Robert Munteanu <rombert@apache.org>
Thanks for looking into this.
Robert
prev parent reply other threads:[~2018-08-03 13:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAPotdmQtXmfHJfcgrXZ02NrPgS3Az=SpZnBsRZ_8dGvPfdi+Mw@mail.gmail.com>
2018-07-28 19:53 ` [PATCH 0/2] "HID: redragon: Fix modifier keys for Redragon Asura Keyboard" causes regression for Acer keyboard John S Gruber
[not found] ` <1532807605-26023-1-git-send-email-JohnSGruber@gmail.com>
2018-07-28 19:53 ` [PATCH 1/2] HID: redragon: Fix regression in non-Redragon keyboard due to this new driver John S Gruber
2018-07-30 14:05 ` Robert Munteanu
2018-07-28 19:53 ` [PATCH 2/2] HID: redragon Add additional verification to rdesc modification quirk John S Gruber
2018-08-03 13:21 ` Robert Munteanu [this message]
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=393a529f40e7d61493178a1baeee5e2679c7da11.camel@apache.org \
--to=rombert@apache.org \
--cc=JohnSGruber@gmail.com \
--cc=benjamin.tissoires@redhat.com \
--cc=dmitry.torokhov@gmail.com \
--cc=jikos@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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).