Blob Blame History Raw
From: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
Date: Fri, 31 Mar 2017 21:25:07 +0200
Subject: drm/sti: use seq_puts to display a string
Git-commit: adea1db2ad3c8a26ffd5b39196b3b376dc861b82
Patch-mainline: v4.13-rc1
References: FATE#326289 FATE#326079 FATE#326049 FATE#322398 FATE#326166

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>
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Link: http://patchwork.freedesktop.org/patch/msgid/20170331192507.20538-1-nicolas.iooss_linux@m4x.org

Acked-by: Petr Tesarik <ptesarik@suse.com>
---
 drivers/gpu/drm/sti/sti_gdp.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/gpu/drm/sti/sti_gdp.c
+++ b/drivers/gpu/drm/sti/sti_gdp.c
@@ -149,7 +149,7 @@ static void gdp_dbg_ctl(struct seq_file
 	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;
 		}
 	}