linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] platform/x86: dell-wmi: Add a comment explaining the 0xb2 magic number
@ 2017-05-27  5:15 Darren Hart
  2017-05-27 10:39 ` Andy Shevchenko
  2017-05-27 10:51 ` Pali Rohár
  0 siblings, 2 replies; 4+ messages in thread
From: Darren Hart @ 2017-05-27  5:15 UTC (permalink / raw)
  To: platform-driver-x86
  Cc: LKML, Andy Lutomirski, Matthew Garrett, Pali Rohár,
	Andy Shevchenko, Darren Hart

From: Andy Lutomirski <luto@kernel.org>

The hotkey table is 0xb2, add a comment for clarity.

Suggested-by: Darren Hart <dvhart@infradead.org>
Signed-off-by: Andy Lutomirski <luto@kernel.org>
Cc: Matthew Garrett <mjg59@srcf.ucam.org>
Cc: "Pali Rohár" <pali.rohar@gmail.com>
Cc: Andy Shevchenko <andy@infradead.org>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.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;
 
-- 
2.9.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] platform/x86: dell-wmi: Add a comment explaining the 0xb2 magic number
  2017-05-27  5:15 [PATCH] platform/x86: dell-wmi: Add a comment explaining the 0xb2 magic number Darren Hart
@ 2017-05-27 10:39 ` Andy Shevchenko
  2017-05-27 10:51 ` Pali Rohár
  1 sibling, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2017-05-27 10:39 UTC (permalink / raw)
  To: Darren Hart
  Cc: Platform Driver, LKML, Andy Lutomirski, Matthew Garrett,
	Pali Rohár, Andy Shevchenko

On Sat, May 27, 2017 at 8:15 AM, Darren Hart <dvhart@infradead.org> wrote:
> From: Andy Lutomirski <luto@kernel.org>
>
> The hotkey table is 0xb2, add a comment for clarity.
>

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

> Suggested-by: Darren Hart <dvhart@infradead.org>
> Signed-off-by: Andy Lutomirski <luto@kernel.org>
> Cc: Matthew Garrett <mjg59@srcf.ucam.org>
> Cc: "Pali Rohár" <pali.rohar@gmail.com>
> Cc: Andy Shevchenko <andy@infradead.org>
> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.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;
>
> --
> 2.9.4
>



-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] platform/x86: dell-wmi: Add a comment explaining the 0xb2 magic number
  2017-05-27  5:15 [PATCH] platform/x86: dell-wmi: Add a comment explaining the 0xb2 magic number Darren Hart
  2017-05-27 10:39 ` Andy Shevchenko
@ 2017-05-27 10:51 ` Pali Rohár
  2017-06-03 19:15   ` Darren Hart
  1 sibling, 1 reply; 4+ messages in thread
From: Pali Rohár @ 2017-05-27 10:51 UTC (permalink / raw)
  To: Darren Hart
  Cc: platform-driver-x86, LKML, Andy Lutomirski, Matthew Garrett,
	Andy Shevchenko

[-- Attachment #1: Type: Text/Plain, Size: 1218 bytes --]

On Saturday 27 May 2017 07:15:28 Darren Hart wrote:
> From: Andy Lutomirski <luto@kernel.org>
> 
> The hotkey table is 0xb2, add a comment for clarity.
> 
> Suggested-by: Darren Hart <dvhart@infradead.org>
> Signed-off-by: Andy Lutomirski <luto@kernel.org>
> Cc: Matthew Garrett <mjg59@srcf.ucam.org>
> Cc: "Pali Rohár" <pali.rohar@gmail.com>
> Cc: Andy Shevchenko <andy@infradead.org>
> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.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@gmail.com>

(Maybe in future we should add a #define name for such magic constants)

-- 
Pali Rohár
pali.rohar@gmail.com

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] platform/x86: dell-wmi: Add a comment explaining the 0xb2 magic number
  2017-05-27 10:51 ` Pali Rohár
@ 2017-06-03 19:15   ` Darren Hart
  0 siblings, 0 replies; 4+ messages in thread
From: Darren Hart @ 2017-06-03 19:15 UTC (permalink / raw)
  To: Pali Rohár
  Cc: platform-driver-x86, LKML, Andy Lutomirski, Matthew Garrett,
	Andy Shevchenko

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@kernel.org>
> > 
> > The hotkey table is 0xb2, add a comment for clarity.
> > 
> > Suggested-by: Darren Hart <dvhart@infradead.org>
> > Signed-off-by: Andy Lutomirski <luto@kernel.org>
> > Cc: Matthew Garrett <mjg59@srcf.ucam.org>
> > Cc: "Pali Rohár" <pali.rohar@gmail.com>
> > Cc: Andy Shevchenko <andy@infradead.org>
> > Signed-off-by: Darren Hart (VMware) <dvhart@infradead.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@gmail.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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-06-03 19:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-27  5:15 [PATCH] platform/x86: dell-wmi: Add a comment explaining the 0xb2 magic number Darren Hart
2017-05-27 10:39 ` Andy Shevchenko
2017-05-27 10:51 ` Pali Rohár
2017-06-03 19:15   ` Darren Hart

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).