Skip to content

Commit

Permalink
drm/tinydrm: mipi-dbi: Silence: ‘cmd’ may be used uninitialized
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
  • Loading branch information
notro authored and airlied committed Feb 24, 2017
1 parent 1e8ad3d commit b401f34
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/tinydrm/mipi-dbi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b401f34

Please sign in to comment.