Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1651757 > unrolled thread

[PATCH] platform/x86: dell-wmi: Add a comment explaining the 0xb2 magic number

Started byDarren Hart <dvhart@infradead.org>
First post2017-05-27 07:20 +0200
Last post2017-06-03 21:20 +0200
Articles 4 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] platform/x86: dell-wmi: Add a comment explaining the 0xb2 magic number Darren Hart <dvhart@infradead.org> - 2017-05-27 07:20 +0200
    Re: [PATCH] platform/x86: dell-wmi: Add a comment explaining the 0xb2  magic number Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-05-27 12:40 +0200
    Re: [PATCH] platform/x86: dell-wmi: Add a comment explaining the 0xb2 magic number Pali Rohár <pali.rohar@gmail.com> - 2017-05-27 13:00 +0200
      Re: [PATCH] platform/x86: dell-wmi: Add a comment explaining the  0xb2 magic number Darren Hart <dvhart@infradead.org> - 2017-06-03 21:20 +0200

#1651757 — [PATCH] platform/x86: dell-wmi: Add a comment explaining the 0xb2 magic number

FromDarren Hart <dvhart@infradead.org>
Date2017-05-27 07:20 +0200
Subject[PATCH] platform/x86: dell-wmi: Add a comment explaining the 0xb2 magic number
Message-ID<tLCiR-7pp-3@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1651847 — Re: [PATCH] platform/x86: dell-wmi: Add a comment explaining the 0xb2 magic number

FromAndy Shevchenko <andy.shevchenko@gmail.com>
Date2017-05-27 12:40 +0200
SubjectRe: [PATCH] platform/x86: dell-wmi: Add a comment explaining the 0xb2 magic number
Message-ID<tLHiy-212-3@gated-at.bofh.it>
In reply to#1651757
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

[toc] | [prev] | [next] | [standalone]


#1651850

FromPali Rohár <pali.rohar@gmail.com>
Date2017-05-27 13:00 +0200
Message-ID<tLHBT-2aL-1@gated-at.bofh.it>
In reply to#1651757

[Multipart message — attachments visible in raw view] — view raw

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

[toc] | [prev] | [next] | [standalone]


#1656908 — Re: [PATCH] platform/x86: dell-wmi: Add a comment explaining the 0xb2 magic number

FromDarren Hart <dvhart@infradead.org>
Date2017-06-03 21:20 +0200
SubjectRe: [PATCH] platform/x86: dell-wmi: Add a comment explaining the 0xb2 magic number
Message-ID<tOmKB-2z6-5@gated-at.bofh.it>
In reply to#1651850
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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web