[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aNxntvKl4QigqMzY@liuwe-devbox-ubuntu-v2.lamzopl0uupeniq2etz1fddiyg.xx.internal.cloudapp.net>
Date: Tue, 30 Sep 2025 23:28:54 +0000
From: Wei Liu <wei.liu@...nel.org>
To: Michael Kelley <mhklinux@...look.com>
Cc: Alok Tiwari <alok.a.tiwari@...cle.com>,
"kys@...rosoft.com" <kys@...rosoft.com>,
"haiyangz@...rosoft.com" <haiyangz@...rosoft.com>,
"wei.liu@...nel.org" <wei.liu@...nel.org>,
"decui@...rosoft.com" <decui@...rosoft.com>,
"linux-hyperv@...r.kernel.org" <linux-hyperv@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] drivers: hv: vmbus: Clean up sscanf format specifier
in target_cpu_store()
On Thu, Sep 18, 2025 at 03:51:00AM +0000, Michael Kelley wrote:
> From: Alok Tiwari <alok.a.tiwari@...cle.com> Sent: Wednesday, September 17, 2025 2:00 AM
> >
> > The target_cpu_store() function parses the target CPU from the sysfs
> > buffer using sscanf(). The format string currently uses "%uu", which
> > is redundant. The compiler ignores the extra "u", so there is no
> > incorrect parsing at runtime.
> >
> > Update the format string to use "%u" for clarity and consistency.
> >
> > Signed-off-by: Alok Tiwari <alok.a.tiwari@...cle.com>
> > ---
> > v1 -> v2
> > Rephrase commit message and subject to clarify
> > that there is no incorrect parsing at runtime.
> > ---
> > drivers/hv/vmbus_drv.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
> > index 5b4f8d009ca5..69591dc7bad2 100644
> > --- a/drivers/hv/vmbus_drv.c
> > +++ b/drivers/hv/vmbus_drv.c
> > @@ -1742,7 +1742,7 @@ static ssize_t target_cpu_store(struct vmbus_channel *channel,
> > u32 target_cpu;
> > ssize_t ret;
> >
> > - if (sscanf(buf, "%uu", &target_cpu) != 1)
> > + if (sscanf(buf, "%u", &target_cpu) != 1)
> > return -EIO;
> >
> > cpus_read_lock();
> > --
> > 2.50.1
>
> Reviewed-by: Michael Kelley <mhklinux@...look.com>
Applied. Thanks.
Powered by blists - more mailing lists