Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/sti: use seq_puts to display a string

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

authored by

Nicolas Iooss and committed by
Benjamin Gaignard
adea1db2 45c3d213

+1 -1
+1 -1
drivers/gpu/drm/sti/sti_gdp.c
··· 149 149 seq_puts(s, "\tColor:"); 150 150 for (i = 0; i < ARRAY_SIZE(gdp_format_to_str); i++) { 151 151 if (gdp_format_to_str[i].format == (val & 0x1F)) { 152 - seq_printf(s, gdp_format_to_str[i].name); 152 + seq_puts(s, gdp_format_to_str[i].name); 153 153 break; 154 154 } 155 155 }