From: Darren Hart <dvhart@infradead.org>
To: "Pali Rohár" <pali.rohar@gmail.com>
Cc: Andy Lutomirski <luto@amacapital.net>,
Andy Lutomirski <luto@kernel.org>,
platform-driver-x86@vger.kernel.org,
Matthew Garrett <mjg59@srcf.ucam.org>
Subject: Re: [PATCH v2] dell-wmi: Improve unknown hotkey handling
Date: Mon, 23 Nov 2015 10:47:40 -0800 [thread overview]
Message-ID: <20151123184740.GR7413@malice.jf.intel.com> (raw)
In-Reply-To: <20151123145643.GH24147@pali>
On Mon, Nov 23, 2015 at 03:56:43PM +0100, Pali Rohár wrote:
> On Friday 20 November 2015 17:30:13 Andy Lutomirski wrote:
> > On Fri, Nov 20, 2015 at 5:27 PM, Andy Lutomirski <luto@kernel.org> wrote:
> > > If DMI lists a hotkey that we don't recognize, log and ignore it
> > > instead of trying to map it to keycode 0. I haven't seen this happen,
> > > but it will help maintain the key map in the future and it will help
> > > avoid sending bogus events.
> > >
> > > This also improves the message that we log when we get an unknown key
> > > event.
> > >
> > > Signed-off-by: Andy Lutomirski <luto@kernel.org>
> > > ---
> > >
> > > Changes from v1:
> > > - Use KEY_RESERVED instead of zero and document why that's okay
> > > - Fix scancode vs keycode confusion in the log message (whoops!)
> > > - Switch from hardcoded 256 to ARRAY_SIZE
> > >
> > > drivers/platform/x86/dell-wmi.c | 25 +++++++++++++++++++++----
> > > 1 file changed, 21 insertions(+), 4 deletions(-)
> > >
> > > diff --git a/drivers/platform/x86/dell-wmi.c b/drivers/platform/x86/dell-wmi.c
> > > index d2daf5417cd7..cb96ef03fa79 100644
> > > --- a/drivers/platform/x86/dell-wmi.c
> > > +++ b/drivers/platform/x86/dell-wmi.c
> >
> >
> > > + /* Uninitialized entries are 0 aka KEY_RESERVED. */
> > > + BUILD_BUG_ON(KEY_RESERVED != 0);
> > > + u16 keycode = (bios_entry->keycode <
> > > + ARRAY_SIZE(bios_to_linux_keycode)) ?
> > > + bios_to_linux_keycode[bios_entry->keycode] :
> > > + KEY_RESERVED;
> >
> > Oops. BUILD_BUG_ON should be below u16 keycode = ... to avoid a
> > warning. Feel free to fix it up. I can also send a v3.
>
> KEY_RESERVED is zero by definition and exported to user space. So this
> should not be redefined otherwise Linux ABI will be broken too.
>
> So I think BUILD_BUG_ON is not needed there.
Queued to testing sans BUILD_BUG_ON. Pali, any further concerns? If not, please
provide a reviewed-by.
Thanks,
--
Darren Hart
Intel Open Source Technology Center
next prev parent reply other threads:[~2015-11-23 18:47 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-21 1:27 [PATCH v2] dell-wmi: Improve unknown hotkey handling Andy Lutomirski
2015-11-21 1:30 ` Andy Lutomirski
2015-11-23 14:56 ` Pali Rohár
2015-11-23 18:47 ` Darren Hart [this message]
2015-11-23 19:29 ` Andy Lutomirski
2015-11-23 19:47 ` Pali Rohár
2015-11-30 18:27 ` Darren Hart
2015-11-30 18:33 ` Andy Lutomirski
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=20151123184740.GR7413@malice.jf.intel.com \
--to=dvhart@infradead.org \
--cc=luto@amacapital.net \
--cc=luto@kernel.org \
--cc=mjg59@srcf.ucam.org \
--cc=pali.rohar@gmail.com \
--cc=platform-driver-x86@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.