From b401f34314db7c60e6d23ee7771cd090b4ef56c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Thu, 23 Feb 2017 14:29:55 +0100 Subject: =?UTF-8?q?drm/tinydrm:=20mipi-dbi:=20Silence:=20=E2=80=98cmd?= =?UTF-8?q?=E2=80=99=20may=20be=20used=20uninitialized?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix this warning: drivers/gpu/drm/tinydrm/mipi-dbi.c: In function ‘mipi_dbi_debugfs_command_write’: drivers/gpu/drm/tinydrm/mipi-dbi.c:905:8: warning: ‘cmd’ may be used uninitialized in this function [-Wmaybe-uninitialized] ret = mipi_dbi_command_buf(mipi, cmd, parameters, i); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cmd can't be used uninitialized, but to satisfy the compiler, initialize it to zero. Signed-off-by: Noralf Trønnes Signed-off-by: Dave Airlie --- drivers/gpu/drm/tinydrm/mipi-dbi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/gpu') diff --git a/drivers/gpu/drm/tinydrm/mipi-dbi.c b/drivers/gpu/drm/tinydrm/mipi-dbi.c index 07d49ba78d8e..2caecdea7ab3 100644 --- a/drivers/gpu/drm/tinydrm/mipi-dbi.c +++ b/drivers/gpu/drm/tinydrm/mipi-dbi.c @@ -863,7 +863,7 @@ static ssize_t mipi_dbi_debugfs_command_write(struct file *file, { struct seq_file *m = file->private_data; struct mipi_dbi *mipi = m->private; - u8 val, cmd, parameters[64]; + u8 val, cmd = 0, parameters[64]; char *buf, *pos, *token; unsigned int i; int ret; -- cgit v1.2.3