From: "Noralf Trønnes" <noralf@tronnes.org>
To: dri-devel@lists.freedesktop.org
Cc: linux-kernel@vger.kernel.org, "Noralf Trønnes" <noralf@tronnes.org>
Subject: [PATCH 1/3] drm/tinydrm: mipi-dbi: Silence: ‘cmd’ may be used uninitialized
Date: Thu, 23 Feb 2017 14:29:55 +0100 [thread overview]
Message-ID: <20170223132957.2839-2-noralf@tronnes.org> (raw)
In-Reply-To: <20170223132957.2839-1-noralf@tronnes.org>
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
next prev parent reply other threads:[~2017-02-23 13:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-23 13:29 [PATCH 0/3] drm/tinydrm: Fix compiler warnings Noralf Trønnes
2017-02-23 13:29 ` Noralf Trønnes [this message]
2017-02-23 13:29 ` [PATCH 2/3] drm/tinydrm: mipi-dbi: Fix field width specifier warning Noralf Trønnes
2017-02-23 13:29 ` [PATCH 3/3] drm/tinydrm: helpers: Properly fix backlight dependency Noralf Trønnes
2017-02-26 22:44 ` Noralf Trønnes
2017-02-27 0:00 ` Daniel Vetter
2017-02-24 1:36 ` [PATCH 0/3] drm/tinydrm: Fix compiler warnings Noralf Trønnes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170223132957.2839-2-noralf@tronnes.org \
--to=noralf@tronnes.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®