Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1586889
| From | Noralf Trønnes <noralf@tronnes.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 1/3] drm/tinydrm: mipi-dbi: Silence: ‘cmd’ may be used uninitialized |
| Date | 2017-02-23 14:40 +0100 |
| Message-ID | <te1ML-1Qh-41@gated-at.bofh.it> (permalink) |
| References | <te1MK-1Qh-31@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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 <noralf@tronnes.org>
---
drivers/gpu/drm/tinydrm/mipi-dbi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/tinydrm/mipi-dbi.c b/drivers/gpu/drm/tinydrm/mipi-dbi.c
index 07d49ba..2caecde 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;
--
2.10.2
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/3] drm/tinydrm: Fix compiler warnings Noralf Trønnes <noralf@tronnes.org> - 2017-02-23 14:40 +0100
[PATCH 1/3] drm/tinydrm: mipi-dbi: Silence: ‘cmd’ may be used uninitialized Noralf Trønnes <noralf@tronnes.org> - 2017-02-23 14:40 +0100
[PATCH 2/3] drm/tinydrm: mipi-dbi: Fix field width specifier warning Noralf Trønnes <noralf@tronnes.org> - 2017-02-23 14:40 +0100
[PATCH 3/3] drm/tinydrm: helpers: Properly fix backlight dependency Noralf Trønnes <noralf@tronnes.org> - 2017-02-23 14:40 +0100
Re: [PATCH 3/3] drm/tinydrm: helpers: Properly fix backlight dependency Noralf Trønnes <noralf@tronnes.org> - 2017-02-26 23:50 +0100
Re: [PATCH 3/3] drm/tinydrm: helpers: Properly fix backlight dependency Daniel Vetter <daniel@ffwll.ch> - 2017-02-27 01:10 +0100
Re: [PATCH 0/3] drm/tinydrm: Fix compiler warnings Noralf Trønnes <noralf@tronnes.org> - 2017-02-24 02:40 +0100
csiph-web