]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
vmsvga: use ARRAY_SIZE macro
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>
Tue, 18 Jul 2017 06:09:58 +0000 (03:09 -0300)
committerGerd Hoffmann <kraxel@redhat.com>
Fri, 10 Nov 2017 13:25:56 +0000 (14:25 +0100)
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>
hw/display/vmware_vga.c

index cdc3fed6ca91fb42d1a012dc67d416ee08f60cd3..0e6673a9119fbacb727ce73fe8e268d5931e3fcd 100644 (file)
@@ -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;
             }