Re: [PATCH] video: omapfb: Use scnprintf() instead of snprintf()

From: Geert Uytterhoeven
Date: Thu Nov 18 2021 - 03:34:07 EST


Hi Guo,

CC cocci

On Wed, Nov 17, 2021 at 1:58 PM Guo Zhengkui <guozhengkui@xxxxxxxx> wrote:
> Fix following warnings:
> ./drivers/video/fbdev/omap/omapfb_main.c:1382:8-16:
> WARNING: use scnprintf or sprintf
> ./drivers/video/fbdev/omap/omapfb_main.c:1306:8-16:
> WARNING: use scnprintf or sprintf
>
> Signed-off-by: Guo Zhengkui <guozhengkui@xxxxxxxx>

Thanks for your patch!

> --- a/drivers/video/fbdev/omap/omapfb_main.c
> +++ b/drivers/video/fbdev/omap/omapfb_main.c
> @@ -1303,7 +1303,7 @@ static ssize_t omapfb_show_panel_name(struct device *dev,
> {
> struct omapfb_device *fbdev = dev_get_drvdata(dev);
>
> - return snprintf(buf, PAGE_SIZE, "%s\n", fbdev->panel->name);
> + return scnprintf(buf, PAGE_SIZE, "%s\n", fbdev->panel->name);
> }

I guess all of these should use sysfs_emit() instead.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds