summary refs log tree commit diff stats
path: root/hw/display
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>2017-07-18 03:09:58 -0300
committerGerd Hoffmann <kraxel@redhat.com>2017-11-10 14:25:56 +0100
commitcf7040e284069fc235172c187551b268c66d8553 (patch)
tree1f549c4e75451eaf622b74e87bb7265e37d6eecd /hw/display
parent115788d7a70e9ae255511ca00fc69cce06967472 (diff)
downloadfocaccia-qemu-cf7040e284069fc235172c187551b268c66d8553.tar.gz
focaccia-qemu-cf7040e284069fc235172c187551b268c66d8553.zip
vmsvga: use ARRAY_SIZE macro
Applied using the Coccinelle semantic patch scripts/coccinelle/use_osdep.cocci

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20170718061005.29518-23-f4bug@amsat.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/display')
-rw-r--r--hw/display/vmware_vga.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c
index cdc3fed6ca..0e6673a911 100644
--- a/hw/display/vmware_vga.c
+++ b/hw/display/vmware_vga.c
@@ -679,10 +679,9 @@ static void vmsvga_fifo_run(struct vmsvga_state_s *s)
             if (cursor.width > 256
                 || cursor.height > 256
                 || cursor.bpp > 32
-                || SVGA_BITMAP_SIZE(x, y)
-                    > sizeof(cursor.mask) / sizeof(cursor.mask[0])
+                || SVGA_BITMAP_SIZE(x, y) > ARRAY_SIZE(cursor.mask)
                 || SVGA_PIXMAP_SIZE(x, y, cursor.bpp)
-                    > sizeof(cursor.image) / sizeof(cursor.image[0])) {
+                    > ARRAY_SIZE(cursor.image)) {
                     goto badcmd;
             }