From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Thierry Reding <thierry.reding@gmail.com>
Cc: linux-pwm@vger.kernel.org,
Alexandre Belloni <alexandre.belloni@bootlin.com>,
kernel@pengutronix.de,
Claudiu Beznea <claudiu.beznea@microchip.com>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 02/10] pwm: atmel-hlcdc: Use consistent variable naming
Date: Thu, 20 Jul 2023 09:29:58 +0200 [thread overview]
Message-ID: <20230720072958.r54d23cefbrytw7r@pengutronix.de> (raw)
In-Reply-To: <ZLjZ_lllJ1PT3O5H@orome>
[-- Attachment #1.1: Type: text/plain, Size: 2083 bytes --]
On Thu, Jul 20, 2023 at 08:53:50AM +0200, Thierry Reding wrote:
> On Fri, Jul 14, 2023 at 10:56:15PM +0200, Uwe Kleine-König wrote:
> > In pwm drivers the variable name "chip" is usually only used for struct
> > pwm_chip pointers. This driver however used "chip" for its driver data
> > and pwm_chip pointers are named "chip", too, when there is no driver
> > data around and "c" otherwise. Instead use "ddata" for driver data and
> > always "chip" for pwm_chips.
> >
> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > ---
> > drivers/pwm/pwm-atmel-hlcdc.c | 64 +++++++++++++++++------------------
> > 1 file changed, 32 insertions(+), 32 deletions(-)
> >
> > diff --git a/drivers/pwm/pwm-atmel-hlcdc.c b/drivers/pwm/pwm-atmel-hlcdc.c
> > index 96a709a9d49a..9b0165d61c49 100644
> > --- a/drivers/pwm/pwm-atmel-hlcdc.c
> > +++ b/drivers/pwm/pwm-atmel-hlcdc.c
> > @@ -38,11 +38,11 @@ static inline struct atmel_hlcdc_pwm *to_atmel_hlcdc_pwm(struct pwm_chip *chip)
> > return container_of(chip, struct atmel_hlcdc_pwm, chip);
> > }
> >
> > -static int atmel_hlcdc_pwm_apply(struct pwm_chip *c, struct pwm_device *pwm,
> > +static int atmel_hlcdc_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
> > const struct pwm_state *state)
> > {
> > - struct atmel_hlcdc_pwm *chip = to_atmel_hlcdc_pwm(c);
> > - struct atmel_hlcdc *hlcdc = chip->hlcdc;
> > + struct atmel_hlcdc_pwm *ddata = to_atmel_hlcdc_pwm(chip);
>
> Can we not just use something like "data", "priv" or "atmel"? "ddata" is
> horrific and looks like a typo.
I like "ddata" which isn't so uncommon (pwm-atmel-hlcdc and pwm-sifive
use it and git grep '\<ddata\>' suggests it's common in other parts of
the kernel, too.)
It's the same naming scheme as "pdata". If you feel strong here, do you
like "drvdata" better? Among your suggestions my favourite is "priv".
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-07-20 7:30 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-14 20:56 [PATCH 00/10] pwm: Constistenly name pwm_chip variables "chip" Uwe Kleine-König
2023-07-14 20:56 ` [PATCH 02/10] pwm: atmel-hlcdc: Use consistent variable naming Uwe Kleine-König
2023-07-16 13:04 ` claudiu beznea
2023-07-20 6:53 ` Thierry Reding
2023-07-20 7:29 ` Uwe Kleine-König [this message]
2023-07-21 17:58 ` Uwe Kleine-König
2023-07-21 18:26 ` Thierry Reding
2023-07-14 20:56 ` [PATCH 07/10] pwm: rockchip: Consistenly name pwm_chip variables "chip" Uwe Kleine-König
2023-07-20 6:48 ` [PATCH 00/10] pwm: Constistenly " Thierry Reding
2023-07-20 7:10 ` Uwe Kleine-König
2023-07-20 15:03 ` Thierry Reding
2023-07-20 14:41 ` Thierry Reding
2023-09-11 4:31 ` patchwork-bot+chrome-platform
2023-09-11 4:49 ` patchwork-bot+chrome-platform
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230720072958.r54d23cefbrytw7r@pengutronix.de \
--to=u.kleine-koenig@pengutronix.de \
--cc=alexandre.belloni@bootlin.com \
--cc=claudiu.beznea@microchip.com \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-pwm@vger.kernel.org \
--cc=thierry.reding@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).