* [PATCH 1/1] drm/sti: use seq_puts to display a string
@ 2017-03-31 19:25 Nicolas Iooss
2017-05-09 10:01 ` Benjamin Gaignard
0 siblings, 1 reply; 2+ messages in thread
From: Nicolas Iooss @ 2017-03-31 19:25 UTC (permalink / raw)
To: Benjamin Gaignard, Vincent Abriou; +Cc: dri-devel, linux-kernel, Nicolas Iooss
gdp_dbg_ctl() uses seq_printf() to display a color format name even
though there is no format string. When using -Wformat-string, gcc
reports the following warning:
drivers/gpu/drm/sti/sti_gdp.c: In function 'gdp_dbg_ctl':
drivers/gpu/drm/sti/sti_gdp.c:150:18: warning: format not a string
literal and no format arguments [-Wformat-security]
seq_printf(s, gdp_format_to_str[i].name);
^~~~~~~~~~~~~~~~~
Silence this warning by using seq_puts() instead.
Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
---
drivers/gpu/drm/sti/sti_gdp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/sti/sti_gdp.c b/drivers/gpu/drm/sti/sti_gdp.c
index 86279f5022c2..1bbfcf01d401 100644
--- a/drivers/gpu/drm/sti/sti_gdp.c
+++ b/drivers/gpu/drm/sti/sti_gdp.c
@@ -147,7 +147,7 @@ static void gdp_dbg_ctl(struct seq_file *s, int val)
seq_puts(s, "\tColor:");
for (i = 0; i < ARRAY_SIZE(gdp_format_to_str); i++) {
if (gdp_format_to_str[i].format == (val & 0x1F)) {
- seq_printf(s, gdp_format_to_str[i].name);
+ seq_puts(s, gdp_format_to_str[i].name);
break;
}
}
--
2.11.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 1/1] drm/sti: use seq_puts to display a string
2017-03-31 19:25 [PATCH 1/1] drm/sti: use seq_puts to display a string Nicolas Iooss
@ 2017-05-09 10:01 ` Benjamin Gaignard
0 siblings, 0 replies; 2+ messages in thread
From: Benjamin Gaignard @ 2017-05-09 10:01 UTC (permalink / raw)
To: Nicolas Iooss; +Cc: Vincent Abriou, dri-devel, Linux Kernel Mailing List
2017-03-31 21:25 GMT+02:00 Nicolas Iooss <nicolas.iooss_linux@m4x.org>:
> gdp_dbg_ctl() uses seq_printf() to display a color format name even
> though there is no format string. When using -Wformat-string, gcc
> reports the following warning:
>
> drivers/gpu/drm/sti/sti_gdp.c: In function 'gdp_dbg_ctl':
> drivers/gpu/drm/sti/sti_gdp.c:150:18: warning: format not a string
> literal and no format arguments [-Wformat-security]
> seq_printf(s, gdp_format_to_str[i].name);
> ^~~~~~~~~~~~~~~~~
>
> Silence this warning by using seq_puts() instead.
>
> Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
> ---
> drivers/gpu/drm/sti/sti_gdp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/sti/sti_gdp.c b/drivers/gpu/drm/sti/sti_gdp.c
> index 86279f5022c2..1bbfcf01d401 100644
> --- a/drivers/gpu/drm/sti/sti_gdp.c
> +++ b/drivers/gpu/drm/sti/sti_gdp.c
> @@ -147,7 +147,7 @@ static void gdp_dbg_ctl(struct seq_file *s, int val)
> seq_puts(s, "\tColor:");
> for (i = 0; i < ARRAY_SIZE(gdp_format_to_str); i++) {
> if (gdp_format_to_str[i].format == (val & 0x1F)) {
> - seq_printf(s, gdp_format_to_str[i].name);
> + seq_puts(s, gdp_format_to_str[i].name);
> break;
> }
> }
> --
> 2.11.1
>
Acked-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-05-09 10:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-31 19:25 [PATCH 1/1] drm/sti: use seq_puts to display a string Nicolas Iooss
2017-05-09 10:01 ` Benjamin Gaignard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®