* [PATCH 2/2] video: fbdev: uvesafb: convert snprintf to scnprintf
@ 2022-09-17 23:44 Jules Irenge
2022-09-25 11:08 ` Helge Deller
0 siblings, 1 reply; 2+ messages in thread
From: Jules Irenge @ 2022-09-17 23:44 UTC (permalink / raw)
To: spock; +Cc: deller, linux-fbdev, dri-devel, Elana.Copperman
Coccinelle reports a warning
WARNING: use scnprintf or sprintf
Adding to that,
there has also been some slow migration from snprintf to scnprintf
This article explains the rationale for this change
https: //lwn.net/Articles/69419/
Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
drivers/video/fbdev/uvesafb.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/video/fbdev/uvesafb.c b/drivers/video/fbdev/uvesafb.c
index 4df6772802d7..fd5d701106e1 100644
--- a/drivers/video/fbdev/uvesafb.c
+++ b/drivers/video/fbdev/uvesafb.c
@@ -1580,7 +1580,7 @@ static ssize_t uvesafb_show_vendor(struct device *dev,
struct uvesafb_par *par = info->par;
if (par->vbe_ib.oem_vendor_name_ptr)
- return snprintf(buf, PAGE_SIZE, "%s\n", (char *)
+ return scnprintf(buf, PAGE_SIZE, "%s\n", (char *)
(&par->vbe_ib) + par->vbe_ib.oem_vendor_name_ptr);
else
return 0;
@@ -1595,7 +1595,7 @@ static ssize_t uvesafb_show_product_name(struct device *dev,
struct uvesafb_par *par = info->par;
if (par->vbe_ib.oem_product_name_ptr)
- return snprintf(buf, PAGE_SIZE, "%s\n", (char *)
+ return scnprintf(buf, PAGE_SIZE, "%s\n", (char *)
(&par->vbe_ib) + par->vbe_ib.oem_product_name_ptr);
else
return 0;
@@ -1610,7 +1610,7 @@ static ssize_t uvesafb_show_product_rev(struct device *dev,
struct uvesafb_par *par = info->par;
if (par->vbe_ib.oem_product_rev_ptr)
- return snprintf(buf, PAGE_SIZE, "%s\n", (char *)
+ return scnprintf(buf, PAGE_SIZE, "%s\n", (char *)
(&par->vbe_ib) + par->vbe_ib.oem_product_rev_ptr);
else
return 0;
@@ -1625,7 +1625,7 @@ static ssize_t uvesafb_show_oem_string(struct device *dev,
struct uvesafb_par *par = info->par;
if (par->vbe_ib.oem_string_ptr)
- return snprintf(buf, PAGE_SIZE, "%s\n",
+ return scnprintf(buf, PAGE_SIZE, "%s\n",
(char *)(&par->vbe_ib) + par->vbe_ib.oem_string_ptr);
else
return 0;
@@ -1639,7 +1639,7 @@ static ssize_t uvesafb_show_nocrtc(struct device *dev,
struct fb_info *info = dev_get_drvdata(dev);
struct uvesafb_par *par = info->par;
- return snprintf(buf, PAGE_SIZE, "%d\n", par->nocrtc);
+ return scnprintf(buf, PAGE_SIZE, "%d\n", par->nocrtc);
}
static ssize_t uvesafb_store_nocrtc(struct device *dev,
--
2.35.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 2/2] video: fbdev: uvesafb: convert snprintf to scnprintf
2022-09-17 23:44 [PATCH 2/2] video: fbdev: uvesafb: convert snprintf to scnprintf Jules Irenge
@ 2022-09-25 11:08 ` Helge Deller
0 siblings, 0 replies; 2+ messages in thread
From: Helge Deller @ 2022-09-25 11:08 UTC (permalink / raw)
To: Jules Irenge, spock; +Cc: linux-fbdev, dri-devel, Elana.Copperman
On 9/18/22 01:44, Jules Irenge wrote:
> Coccinelle reports a warning
>
> WARNING: use scnprintf or sprintf
>
> Adding to that,
> there has also been some slow migration from snprintf to scnprintf
> This article explains the rationale for this change
>
> https: //lwn.net/Articles/69419/
> Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
applied.
Thanks,
Helge
> ---
> drivers/video/fbdev/uvesafb.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/video/fbdev/uvesafb.c b/drivers/video/fbdev/uvesafb.c
> index 4df6772802d7..fd5d701106e1 100644
> --- a/drivers/video/fbdev/uvesafb.c
> +++ b/drivers/video/fbdev/uvesafb.c
> @@ -1580,7 +1580,7 @@ static ssize_t uvesafb_show_vendor(struct device *dev,
> struct uvesafb_par *par = info->par;
>
> if (par->vbe_ib.oem_vendor_name_ptr)
> - return snprintf(buf, PAGE_SIZE, "%s\n", (char *)
> + return scnprintf(buf, PAGE_SIZE, "%s\n", (char *)
> (&par->vbe_ib) + par->vbe_ib.oem_vendor_name_ptr);
> else
> return 0;
> @@ -1595,7 +1595,7 @@ static ssize_t uvesafb_show_product_name(struct device *dev,
> struct uvesafb_par *par = info->par;
>
> if (par->vbe_ib.oem_product_name_ptr)
> - return snprintf(buf, PAGE_SIZE, "%s\n", (char *)
> + return scnprintf(buf, PAGE_SIZE, "%s\n", (char *)
> (&par->vbe_ib) + par->vbe_ib.oem_product_name_ptr);
> else
> return 0;
> @@ -1610,7 +1610,7 @@ static ssize_t uvesafb_show_product_rev(struct device *dev,
> struct uvesafb_par *par = info->par;
>
> if (par->vbe_ib.oem_product_rev_ptr)
> - return snprintf(buf, PAGE_SIZE, "%s\n", (char *)
> + return scnprintf(buf, PAGE_SIZE, "%s\n", (char *)
> (&par->vbe_ib) + par->vbe_ib.oem_product_rev_ptr);
> else
> return 0;
> @@ -1625,7 +1625,7 @@ static ssize_t uvesafb_show_oem_string(struct device *dev,
> struct uvesafb_par *par = info->par;
>
> if (par->vbe_ib.oem_string_ptr)
> - return snprintf(buf, PAGE_SIZE, "%s\n",
> + return scnprintf(buf, PAGE_SIZE, "%s\n",
> (char *)(&par->vbe_ib) + par->vbe_ib.oem_string_ptr);
> else
> return 0;
> @@ -1639,7 +1639,7 @@ static ssize_t uvesafb_show_nocrtc(struct device *dev,
> struct fb_info *info = dev_get_drvdata(dev);
> struct uvesafb_par *par = info->par;
>
> - return snprintf(buf, PAGE_SIZE, "%d\n", par->nocrtc);
> + return scnprintf(buf, PAGE_SIZE, "%d\n", par->nocrtc);
> }
>
> static ssize_t uvesafb_store_nocrtc(struct device *dev,
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-09-25 11:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-17 23:44 [PATCH 2/2] video: fbdev: uvesafb: convert snprintf to scnprintf Jules Irenge
2022-09-25 11:08 ` Helge Deller
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).