lkml.org 
[lkml]   [2018]   [Mar]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] video: fbdev: via_aux_vt1632: remove VLA usage
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
\
 
 \ /
  Last update: 2018-03-07 20:55    [W:0.041 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site