[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJZ5v0iAfgE4RkVXH7GaG9SqvGa0VfVuFi_cLd0utC8oPY0Fkg@mail.gmail.com>
Date: Fri, 5 Sep 2025 20:34:23 +0200
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Joe Perches <joe@...ches.com>
Cc: vivek yadav <vivekyadav1207731111@...il.com>, "Rafael J. Wysocki" <rafael@...nel.org>,
daniel.lezcano@...aro.org, linux-kernel@...r.kernel.org,
linux-pm@...r.kernel.org
Subject: Re: [PATCH] cpuidle: sysfs: Use sysfs_emit/sysfs_emit_at instead of sprintf/scnprintf
On Fri, Sep 5, 2025 at 8:22 PM Joe Perches <joe@...ches.com> wrote:
>
> On Fri, 2025-09-05 at 22:57 +0530, vivek yadav wrote:
> > On Mon, Aug 25, 2025 at 8:58 PM <vivekyadav1207731111@...il.com> wrote:
> > > >
> > > > From: Vivek Yadav <vivekyadav1207731111@...il.com>
> > > >
> > > > The ->show() callbacks in sysfs should use sysfs_emit() or
> > > > sysfs_emit_at()
> []
> > > > diff --git a/drivers/cpuidle/sysfs.c b/drivers/cpuidle/sysfs.c
> []
> > > > @@ -22,21 +22,21 @@ static ssize_t show_available_governors(struct device *dev,
> > > > struct device_attribute *attr,
> > > > char *buf)
> > > > {
> > > > - ssize_t i = 0;
> > > > + ssize_t len = 0;
> > >
> > > The variable rename is not necessary or even useful AFAICS ->
> >
> > There is no harm if we leave the variable name as 'i' but it would be better
> > if we give it a suitable name like 'offset'. It will definitely improve
> > readability.
>
> size and len are most commonly used.
> I prefer len.
Fine, in new code, use whatever you like, but what really is the
reason for doing a rename in code that has been almost unchanged since
2.6.22?
Powered by blists - more mailing lists