2021-04-08 08:56:54

by Xuezhi zhang

[permalink] [raw]
Subject: [PATCH v2] drm/panel: panel-dsi-cm: convert sysfs snprintf to sysfs_emit

From: Xuezhi Zhang <[email protected]>

Fix the following coccicheck warning:
drivers/gpu/drm//panel/panel-dsi-cm.c:271:8-16:
WARNING: use scnprintf or sprintf
drivers/gpu/drm//panel/panel-dsi-cm.c:251:8-16:
WARNING: use scnprintf or sprintf

Signed-off-by: Xuezhi Zhang <[email protected]>
---
v2: change snprint to snprintf in subject.
---
drivers/gpu/drm/panel/panel-dsi-cm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-dsi-cm.c b/drivers/gpu/drm/panel/panel-dsi-cm.c
index 5fbfb71ca3d9..a8efb06cca64 100644
--- a/drivers/gpu/drm/panel/panel-dsi-cm.c
+++ b/drivers/gpu/drm/panel/panel-dsi-cm.c
@@ -248,7 +248,7 @@ static ssize_t num_dsi_errors_show(struct device *dev,
if (r)
return r;

- return snprintf(buf, PAGE_SIZE, "%d\n", errors);
+ return sysfs_emit(buf, "%d\n", errors);
}

static ssize_t hw_revision_show(struct device *dev,
@@ -268,7 +268,7 @@ static ssize_t hw_revision_show(struct device *dev,
if (r)
return r;

- return snprintf(buf, PAGE_SIZE, "%02x.%02x.%02x\n", id1, id2, id3);
+ return sysfs_emit(buf, "%02x.%02x.%02x\n", id1, id2, id3);
}

static DEVICE_ATTR_RO(num_dsi_errors);
--
2.25.1


2021-04-08 13:14:59

by Thierry Reding

[permalink] [raw]
Subject: Re: [PATCH v2] drm/panel: panel-dsi-cm: convert sysfs snprintf to sysfs_emit

On Thu, Apr 08, 2021 at 08:52:57AM +0000, Carlis wrote:
> From: Xuezhi Zhang <[email protected]>
>
> Fix the following coccicheck warning:
> drivers/gpu/drm//panel/panel-dsi-cm.c:271:8-16:
> WARNING: use scnprintf or sprintf
> drivers/gpu/drm//panel/panel-dsi-cm.c:251:8-16:
> WARNING: use scnprintf or sprintf
>
> Signed-off-by: Xuezhi Zhang <[email protected]>
> ---
> v2: change snprint to snprintf in subject.
> ---
> drivers/gpu/drm/panel/panel-dsi-cm.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)

Nit: I suspect you might've just resent this from some private email
address, but it's kind of hard to tell because you haven't been using
at least the same name in both email addresses.

However, if you're forwarding this patch on behalf of somebody else you
need to add your own Signed-off-by: line.

Reviewed-by: Thierry Reding <[email protected]>


Attachments:
(No filename) (913.00 B)
signature.asc (849.00 B)
Download all attachments

2021-04-08 15:14:41

by Xuezhi zhang

[permalink] [raw]
Subject: Re: [PATCH v2] drm/panel: panel-dsi-cm: convert sysfs snprintf to sysfs_emit

On Thu, 8 Apr 2021 15:14:04 +0200
Thierry Reding <[email protected]> wrote:

> On Thu, Apr 08, 2021 at 08:52:57AM +0000, Carlis wrote:
> > From: Xuezhi Zhang <[email protected]>
> >
> > Fix the following coccicheck warning:
> > drivers/gpu/drm//panel/panel-dsi-cm.c:271:8-16:
> > WARNING: use scnprintf or sprintf
> > drivers/gpu/drm//panel/panel-dsi-cm.c:251:8-16:
> > WARNING: use scnprintf or sprintf
> >
> > Signed-off-by: Xuezhi Zhang <[email protected]>
> > ---
> > v2: change snprint to snprintf in subject.
> > ---
> > drivers/gpu/drm/panel/panel-dsi-cm.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
>
> Nit: I suspect you might've just resent this from some private email
> address, but it's kind of hard to tell because you haven't been using
> at least the same name in both email addresses.
>
> However, if you're forwarding this patch on behalf of somebody else
> you need to add your own Signed-off-by: line.
>
> Reviewed-by: Thierry Reding <[email protected]>

Hi,
the email address of [email protected] is my private email address,
and [email protected] is my company email address, and Carlis is
my English name ,Xuezhi Zhang is my Chinese name, i will use the
Chinese name to send the emails and patchs in the future.

thanks,

Xuezhi Zhang

2021-04-09 11:37:34

by Thierry Reding

[permalink] [raw]
Subject: Re: [PATCH v2] drm/panel: panel-dsi-cm: convert sysfs snprintf to sysfs_emit

On Thu, Apr 08, 2021 at 11:08:49PM +0800, Xuezhi zhang wrote:
> On Thu, 8 Apr 2021 15:14:04 +0200
> Thierry Reding <[email protected]> wrote:
>
> > On Thu, Apr 08, 2021 at 08:52:57AM +0000, Carlis wrote:
> > > From: Xuezhi Zhang <[email protected]>
> > >
> > > Fix the following coccicheck warning:
> > > drivers/gpu/drm//panel/panel-dsi-cm.c:271:8-16:
> > > WARNING: use scnprintf or sprintf
> > > drivers/gpu/drm//panel/panel-dsi-cm.c:251:8-16:
> > > WARNING: use scnprintf or sprintf
> > >
> > > Signed-off-by: Xuezhi Zhang <[email protected]>
> > > ---
> > > v2: change snprint to snprintf in subject.
> > > ---
> > > drivers/gpu/drm/panel/panel-dsi-cm.c | 4 ++--
> > > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > Nit: I suspect you might've just resent this from some private email
> > address, but it's kind of hard to tell because you haven't been using
> > at least the same name in both email addresses.
> >
> > However, if you're forwarding this patch on behalf of somebody else
> > you need to add your own Signed-off-by: line.
> >
> > Reviewed-by: Thierry Reding <[email protected]>
>
> Hi,
> the email address of [email protected] is my private email address,
> and [email protected] is my company email address, and Carlis is
> my English name ,Xuezhi Zhang is my Chinese name, i will use the
> Chinese name to send the emails and patchs in the future.
>
> thanks,

It's not a big deal, I'm just mentioning it because it can confuse
people. Yes, using the same name in either case is usually a good way to
make people realize what's going on.

Thierry


Attachments:
(No filename) (1.63 kB)
signature.asc (849.00 B)
Download all attachments