lkml.org 
[lkml]   [2020]   [Jun]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 09/22] gpiolib: cdev: rename priv to gcdev
On Wed, Jun 24, 2020 at 04:20:49PM +0200, Bartosz Golaszewski wrote:
> śr., 24 cze 2020 o 16:19 Kent Gibson <warthog618@gmail.com> napisał(a):
> >
> > On Wed, Jun 24, 2020 at 04:04:09PM +0200, Bartosz Golaszewski wrote:
> > > wt., 23 cze 2020 o 06:02 Kent Gibson <warthog618@gmail.com> napisał(a):
> > > >
> > > > Rename priv to gcdev to improve readability.
> > > >
> > > > The name "priv" indicates that the object is pointed to by
> > > > file->private_data, not what the object is actually is.
> > > > It is always used to point to a struct gpio_chardev_data so renaming
> > > > it to gcdev seemed as good as anything, and certainly clearer than "priv".
> > > >
> > > > Signed-off-by: Kent Gibson <warthog618@gmail.com>
> > > >
> > >
> > > Ugh now it's gcdev and gdev everywhere and it doesn't really make it
> > > more readable. Maybe chardev_data or cdev_data?
> > >
> >
> > Agreed, it isn't ideal visually, but is at least more unique than priv.
> > Linus was going for short names recently (e.g. gc for gpiochip), so I was
> > going for something short.
> >
> > And I try avoid names ending in _data or _state or similar where they
> > don't really add anything.
> >
> > Would chardev or gchardev work for you?
> >
>
> Yes, chardev is fine. Even cdev is fine for me: gdev vs gcdev is
> confusing but gdev vs cdev looks better IMO.
>

OK, I was avoiding cdev to try to make the name more likely to be
globally unique, hence the leading "g".

To try to keep it short, how about attacking it from the other end and
reducing it to gcd?
That would also be in keeping with the naming convention I use in later
patches, e.g. glv for gpioline_values.
So gcd for gpio_chardev_data. Hmmm, or maybe gcdd?

Why is it that naming things is always the hardest part ;-)?

Cheers,
Kent.

\
 
 \ /
  Last update: 2020-06-25 01:16    [W:0.183 / U:0.364 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site