lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Sat, 3 Jun 2017 12:15:21 -0700
From:   Darren Hart <dvhart@...radead.org>
To:     Pali Rohár <pali.rohar@...il.com>
Cc:     platform-driver-x86@...r.kernel.org,
        LKML <linux-kernel@...r.kernel.org>,
        Andy Lutomirski <luto@...nel.org>,
        Matthew Garrett <mjg59@...f.ucam.org>,
        Andy Shevchenko <andy@...radead.org>
Subject: Re: [PATCH] platform/x86: dell-wmi: Add a comment explaining the
 0xb2 magic number

On Sat, May 27, 2017 at 12:51:36PM +0200, Pali Rohár wrote:
> On Saturday 27 May 2017 07:15:28 Darren Hart wrote:
> > From: Andy Lutomirski <luto@...nel.org>
> > 
> > The hotkey table is 0xb2, add a comment for clarity.
> > 
> > Suggested-by: Darren Hart <dvhart@...radead.org>
> > Signed-off-by: Andy Lutomirski <luto@...nel.org>
> > Cc: Matthew Garrett <mjg59@...f.ucam.org>
> > Cc: "Pali Rohár" <pali.rohar@...il.com>
> > Cc: Andy Shevchenko <andy@...radead.org>
> > Signed-off-by: Darren Hart (VMware) <dvhart@...radead.org>
> > ---
> >  drivers/platform/x86/dell-wmi.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/drivers/platform/x86/dell-wmi.c
> > b/drivers/platform/x86/dell-wmi.c index 8a64c79..24467b1 100644
> > --- a/drivers/platform/x86/dell-wmi.c
> > +++ b/drivers/platform/x86/dell-wmi.c
> > @@ -449,6 +449,7 @@ static void __init handle_dmi_entry(const struct
> > dmi_header *dm, if (results->err || results->keymap)
> >  		return;		/* We already found the hotkey table. */
> > 
> > +	/* The Dell hotkey table is type 0xB2.  Scan until we find it. */
> >  	if (dm->type != 0xb2)
> >  		return;
> 
> Good. Reviewed-by: Pali Rohár <pali.rohar@...il.com>
> 
> (Maybe in future we should add a #define name for such magic constants)

Thanks for the review.

A define is most useful, in my opinion, when the magic number is required
multiple times, as it avoids human error and avoids maintenance issues when
updated, etc. I'm not necessarily opposed, but I didn't think it was necessary
in this case.

-- 
Darren Hart
VMware Open Source Technology Center

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ