From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
To: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>,
Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org,
"Gustavo A. R. Silva" <garsilva@embeddedor.com>
Subject: [PATCH] video: fbdev: via_aux_vt1632: remove VLA usage
Date: Wed, 07 Mar 2018 19:54:15 +0000 [thread overview]
Message-ID: <20180307195415.GA666@embeddedgus> (raw)
In preparation to enabling -Wvla, remove VLA and replace it
with a fixed-length array instead. Also, remove variable 'len'.
Notice that no new IDs have been added in seven years.
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
drivers/video/fbdev/via/via_aux_vt1632.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/video/fbdev/via/via_aux_vt1632.c b/drivers/video/fbdev/via/via_aux_vt1632.c
index d24f4cd..0cd0d2a 100644
--- a/drivers/video/fbdev/via/via_aux_vt1632.c
+++ b/drivers/video/fbdev/via/via_aux_vt1632.c
@@ -35,10 +35,10 @@ static void probe(struct via_aux_bus *bus, u8 addr)
.addr = addr,
.name = name};
/* check vendor id and device id */
- const u8 id[] = {0x06, 0x11, 0x92, 0x31}, len = ARRAY_SIZE(id);
- u8 tmp[len];
+ const u8 id[4] = {0x06, 0x11, 0x92, 0x31};
+ u8 tmp[4];
- if (!via_aux_read(&drv, 0x00, tmp, len) || memcmp(id, tmp, len))
+ if (!via_aux_read(&drv, 0x00, tmp, 4) || memcmp(id, tmp, 4))
return;
printk(KERN_INFO "viafb: Found %s at address 0x%x\n", name, addr);
--
2.7.4
WARNING: multiple messages have this Message-ID (diff)
From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
To: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>,
Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org,
"Gustavo A. R. Silva" <garsilva@embeddedor.com>
Subject: [PATCH] video: fbdev: via_aux_vt1632: remove VLA usage
Date: Wed, 7 Mar 2018 13:54:15 -0600 [thread overview]
Message-ID: <20180307195415.GA666@embeddedgus> (raw)
In preparation to enabling -Wvla, remove VLA and replace it
with a fixed-length array instead. Also, remove variable 'len'.
Notice that no new IDs have been added in seven years.
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
drivers/video/fbdev/via/via_aux_vt1632.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/video/fbdev/via/via_aux_vt1632.c b/drivers/video/fbdev/via/via_aux_vt1632.c
index d24f4cd..0cd0d2a 100644
--- a/drivers/video/fbdev/via/via_aux_vt1632.c
+++ b/drivers/video/fbdev/via/via_aux_vt1632.c
@@ -35,10 +35,10 @@ static void probe(struct via_aux_bus *bus, u8 addr)
.addr = addr,
.name = name};
/* check vendor id and device id */
- const u8 id[] = {0x06, 0x11, 0x92, 0x31}, len = ARRAY_SIZE(id);
- u8 tmp[len];
+ const u8 id[4] = {0x06, 0x11, 0x92, 0x31};
+ u8 tmp[4];
- if (!via_aux_read(&drv, 0x00, tmp, len) || memcmp(id, tmp, len))
+ if (!via_aux_read(&drv, 0x00, tmp, 4) || memcmp(id, tmp, 4))
return;
printk(KERN_INFO "viafb: Found %s at address 0x%x\n", name, addr);
--
2.7.4
next reply other threads:[~2018-03-07 19:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-07 19:54 Gustavo A. R. Silva [this message]
2018-03-07 19:54 ` [PATCH] video: fbdev: via_aux_vt1632: remove VLA usage Gustavo A. R. Silva
2018-03-08 11:58 ` Emil Velikov
2018-03-08 11:58 ` Emil Velikov
2018-03-08 11:58 ` Emil Velikov
2018-03-08 17:27 ` Gustavo A. R. Silva
2018-03-08 17:27 ` Gustavo A. R. Silva
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=20180307195415.GA666@embeddedgus \
--to=gustavo@embeddedor.com \
--cc=FlorianSchandinat@gmx.de \
--cc=b.zolnierkie@samsung.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=garsilva@embeddedor.com \
--cc=linux-fbdev@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.