[Qemu-devel] [PATCH 22/29] vmsvga: use ARRAY_SIZE macro

Philippe Mathieu-Daudé posted 29 patches 8 years, 6 months ago
Only 28 patches received!
[Qemu-devel] [PATCH 22/29] vmsvga: use ARRAY_SIZE macro
Posted by Philippe Mathieu-Daudé 8 years, 6 months ago
Applied using the Coccinelle semantic patch scripts/coccinelle/use_osdep.cocci

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---

No entry in MAINTAINERS, should it go under Graphics or Vmware?

 hw/display/vmware_vga.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c
index 4a64b41259..ff8130ff70 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;
             }
 
-- 
2.13.2


Re: [Qemu-devel] [PATCH 22/29] vmsvga: use ARRAY_SIZE macro
Posted by Marc-André Lureau 8 years, 6 months ago
On Mon, Jul 17, 2017 at 11:09 PM, Philippe Mathieu-Daudé
<f4bug@amsat.org> wrote:
> Applied using the Coccinelle semantic patch scripts/coccinelle/use_osdep.cocci
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>


> ---
>
> No entry in MAINTAINERS, should it go under Graphics or Vmware?
>
>  hw/display/vmware_vga.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c
> index 4a64b41259..ff8130ff70 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;
>              }
>
> --
> 2.13.2
>
>



-- 
Marc-André Lureau