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


Groups > linux.kernel > #1633665 > unrolled thread

Re: [PATCH 02/10] platform/x86: fujitsu-laptop: shorten names of acpi_handle fields

Started byJonathan Woithe <jwoithe@just42.net>
First post2017-05-01 15:30 +0200
Last post2017-05-01 18:20 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH 02/10] platform/x86: fujitsu-laptop: shorten names of  acpi_handle fields Jonathan Woithe <jwoithe@just42.net> - 2017-05-01 15:30 +0200
    Re: [PATCH 02/10] platform/x86: fujitsu-laptop: shorten names of  acpi_handle fields Darren Hart <dvhart@infradead.org> - 2017-05-01 18:20 +0200

#1633665 — Re: [PATCH 02/10] platform/x86: fujitsu-laptop: shorten names of acpi_handle fields

FromJonathan Woithe <jwoithe@just42.net>
Date2017-05-01 15:30 +0200
SubjectRe: [PATCH 02/10] platform/x86: fujitsu-laptop: shorten names of acpi_handle fields
Message-ID<tCjyO-1f8-15@gated-at.bofh.it>
On Mon, Apr 24, 2017 at 03:33:26PM +0200, Micha?? K??pie?? wrote:
> As both struct fujitsu_bl and struct fujitsu_laptop represent data
> associated with ACPI devices, drop the "acpi_" prefix from the names of
> the relevant fields of these structures to save some horizontal space.
> 
> Signed-off-by: Micha?? K??pie?? <kernel@kempniu.pl>
> ---
>  drivers/platform/x86/fujitsu-laptop.c | 23 +++++++++++------------
>  1 file changed, 11 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c
> index 3f232967af04..3695e8075aa6 100644
> --- a/drivers/platform/x86/fujitsu-laptop.c
> +++ b/drivers/platform/x86/fujitsu-laptop.c
> @@ -130,7 +130,7 @@
>  
>  /* Device controlling the backlight and associated keys */
>  struct fujitsu_bl {
> -	acpi_handle acpi_handle;
> +	acpi_handle handle;

I must admit I'm not entirely convinced about this change.  "handle" to me
is very generic and it's not immediately clear from the source usage what it
might be a handle of.  A later patch in the series introduces an additional
handle which includes a suitable suffix, which leaves us with generic and
specific handles within the code.  Although it consumes an additional 5
characters, my feeling is that the additional clarification is worth it.

Regards
  jonathan

[toc] | [next] | [standalone]


#1633730

FromDarren Hart <dvhart@infradead.org>
Date2017-05-01 18:20 +0200
Message-ID<tCmdk-2Ui-17@gated-at.bofh.it>
In reply to#1633665
On Mon, May 01, 2017 at 10:49:26PM +0930, Jonathan Woithe wrote:
> On Mon, Apr 24, 2017 at 03:33:26PM +0200, Micha?? K??pie?? wrote:
> > As both struct fujitsu_bl and struct fujitsu_laptop represent data
> > associated with ACPI devices, drop the "acpi_" prefix from the names of
> > the relevant fields of these structures to save some horizontal space.
> > 
> > Signed-off-by: Micha?? K??pie?? <kernel@kempniu.pl>
> > ---
> >  drivers/platform/x86/fujitsu-laptop.c | 23 +++++++++++------------
> >  1 file changed, 11 insertions(+), 12 deletions(-)
> > 
> > diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c
> > index 3f232967af04..3695e8075aa6 100644
> > --- a/drivers/platform/x86/fujitsu-laptop.c
> > +++ b/drivers/platform/x86/fujitsu-laptop.c
> > @@ -130,7 +130,7 @@
> >  
> >  /* Device controlling the backlight and associated keys */
> >  struct fujitsu_bl {
> > -	acpi_handle acpi_handle;
> > +	acpi_handle handle;
> 
> I must admit I'm not entirely convinced about this change.  "handle" to me
> is very generic and it's not immediately clear from the source usage what it
> might be a handle of.  A later patch in the series introduces an additional
> handle which includes a suitable suffix, which leaves us with generic and
> specific handles within the code.  Although it consumes an additional 5
> characters, my feeling is that the additional clarification is worth it.

ACPI handles are commonly "handle" in other drivers - and it does make me cringe
to see the type reused as the variable name :-) That much at least, I appreciate
in this patch.

dvhart@fury:~/source/linux/linux-pdx86 [testing]
$ git grep "acpi_handle handle" | wc -l
520

dvhart@fury:~/source/linux/linux-pdx86 [testing]
$ git grep "acpi_handle acpi_handle" | wc -l
4

-- 
Darren Hart
VMware Open Source Technology Center

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web