All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/2] tcx/cg3: fix warnings reported by Coverity
@ 2017-05-01  7:39 Mark Cave-Ayland
  2017-05-01  7:39 ` [Qemu-devel] [PATCH 1/2] tcx: fix cut/paste error in update_palette_entries() Mark Cave-Ayland
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Mark Cave-Ayland @ 2017-05-01  7:39 UTC (permalink / raw)
  To: qemu-devel, peter.maydell, kraxel

This patchset fixes up a couple of issues from my last set of tcx/cg3 updates
spotted by Coverity as reported by Peter.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>

Mark Cave-Ayland (2):
  tcx: fix cut/paste error in update_palette_entries()
  cg3: add explicit ram_addr_t cast to scanline page variable

 hw/display/cg3.c |    2 +-
 hw/display/tcx.c |    1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

-- 
1.7.10.4

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Qemu-devel] [PATCH 1/2] tcx: fix cut/paste error in update_palette_entries()
  2017-05-01  7:39 [Qemu-devel] [PATCH 0/2] tcx/cg3: fix warnings reported by Coverity Mark Cave-Ayland
@ 2017-05-01  7:39 ` Mark Cave-Ayland
  2017-05-01  7:39 ` [Qemu-devel] [PATCH 2/2] cg3: add explicit ram_addr_t cast to scanline page variable Mark Cave-Ayland
  2017-05-05  8:51 ` [Qemu-devel] [PATCH 0/2] tcx/cg3: fix warnings reported by Coverity Mark Cave-Ayland
  2 siblings, 0 replies; 5+ messages in thread
From: Mark Cave-Ayland @ 2017-05-01  7:39 UTC (permalink / raw)
  To: qemu-devel, peter.maydell, kraxel

Commit ee72bed0 "tcx: remove primitives for non-32-bit surfaces" accidentally
left a trailing break in update_palette_entries() causing the palette update
routine to exit after just one iteration. Remove it.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
 hw/display/tcx.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/hw/display/tcx.c b/hw/display/tcx.c
index 5a1115c..0e66dcd 100644
--- a/hw/display/tcx.c
+++ b/hw/display/tcx.c
@@ -145,7 +145,6 @@ static void update_palette_entries(TCXState *s, int start, int end)
         } else {
             s->palette[i] = rgb_to_pixel32(s->r[i], s->g[i], s->b[i]);
         }
-        break;
     }
     tcx_set_dirty(s, 0, memory_region_size(&s->vram_mem));
 }
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Qemu-devel] [PATCH 2/2] cg3: add explicit ram_addr_t cast to scanline page variable
  2017-05-01  7:39 [Qemu-devel] [PATCH 0/2] tcx/cg3: fix warnings reported by Coverity Mark Cave-Ayland
  2017-05-01  7:39 ` [Qemu-devel] [PATCH 1/2] tcx: fix cut/paste error in update_palette_entries() Mark Cave-Ayland
@ 2017-05-01  7:39 ` Mark Cave-Ayland
  2017-05-01 21:43   ` Philippe Mathieu-Daudé
  2017-05-05  8:51 ` [Qemu-devel] [PATCH 0/2] tcx/cg3: fix warnings reported by Coverity Mark Cave-Ayland
  2 siblings, 1 reply; 5+ messages in thread
From: Mark Cave-Ayland @ 2017-05-01  7:39 UTC (permalink / raw)
  To: qemu-devel, peter.maydell, kraxel

Coverity warns that multiplying two 32-bit values gives a 32-bit result which
is assigned to a 64-bit variable. Add an explicit ram_addr_t cast to silence
the warning.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
 hw/display/cg3.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/display/cg3.c b/hw/display/cg3.c
index 03d9197..7ef8a96 100644
--- a/hw/display/cg3.c
+++ b/hw/display/cg3.c
@@ -113,7 +113,7 @@ static void cg3_update_display(void *opaque)
     for (y = 0; y < height; y++) {
         int update = s->full_update;
 
-        page = y * width;
+        page = (ram_addr_t)y * width;
         update |= memory_region_get_dirty(&s->vram_mem, page, width,
                                           DIRTY_MEMORY_VGA);
         if (update) {
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH 2/2] cg3: add explicit ram_addr_t cast to scanline page variable
  2017-05-01  7:39 ` [Qemu-devel] [PATCH 2/2] cg3: add explicit ram_addr_t cast to scanline page variable Mark Cave-Ayland
@ 2017-05-01 21:43   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-05-01 21:43 UTC (permalink / raw)
  To: Mark Cave-Ayland, qemu-devel, peter.maydell, kraxel

On 05/01/2017 04:39 AM, Mark Cave-Ayland wrote:
> Coverity warns that multiplying two 32-bit values gives a 32-bit result which
> is assigned to a 64-bit variable. Add an explicit ram_addr_t cast to silence
> the warning.
>
> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>

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

> ---
>  hw/display/cg3.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/display/cg3.c b/hw/display/cg3.c
> index 03d9197..7ef8a96 100644
> --- a/hw/display/cg3.c
> +++ b/hw/display/cg3.c
> @@ -113,7 +113,7 @@ static void cg3_update_display(void *opaque)
>      for (y = 0; y < height; y++) {
>          int update = s->full_update;
>
> -        page = y * width;
> +        page = (ram_addr_t)y * width;
>          update |= memory_region_get_dirty(&s->vram_mem, page, width,
>                                            DIRTY_MEMORY_VGA);
>          if (update) {
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH 0/2] tcx/cg3: fix warnings reported by Coverity
  2017-05-01  7:39 [Qemu-devel] [PATCH 0/2] tcx/cg3: fix warnings reported by Coverity Mark Cave-Ayland
  2017-05-01  7:39 ` [Qemu-devel] [PATCH 1/2] tcx: fix cut/paste error in update_palette_entries() Mark Cave-Ayland
  2017-05-01  7:39 ` [Qemu-devel] [PATCH 2/2] cg3: add explicit ram_addr_t cast to scanline page variable Mark Cave-Ayland
@ 2017-05-05  8:51 ` Mark Cave-Ayland
  2 siblings, 0 replies; 5+ messages in thread
From: Mark Cave-Ayland @ 2017-05-05  8:51 UTC (permalink / raw)
  To: qemu-devel, peter.maydell, kraxel

On 01/05/17 08:39, Mark Cave-Ayland wrote:

> This patchset fixes up a couple of issues from my last set of tcx/cg3 updates
> spotted by Coverity as reported by Peter.
> 
> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> 
> Mark Cave-Ayland (2):
>   tcx: fix cut/paste error in update_palette_entries()
>   cg3: add explicit ram_addr_t cast to scanline page variable
> 
>  hw/display/cg3.c |    2 +-
>  hw/display/tcx.c |    1 -
>  2 files changed, 1 insertion(+), 2 deletions(-)

No further comments, so I've added Philippe's R-B and applied to qemu-sparc.


ATB,

Mark.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-05-05  8:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-01  7:39 [Qemu-devel] [PATCH 0/2] tcx/cg3: fix warnings reported by Coverity Mark Cave-Ayland
2017-05-01  7:39 ` [Qemu-devel] [PATCH 1/2] tcx: fix cut/paste error in update_palette_entries() Mark Cave-Ayland
2017-05-01  7:39 ` [Qemu-devel] [PATCH 2/2] cg3: add explicit ram_addr_t cast to scanline page variable Mark Cave-Ayland
2017-05-01 21:43   ` Philippe Mathieu-Daudé
2017-05-05  8:51 ` [Qemu-devel] [PATCH 0/2] tcx/cg3: fix warnings reported by Coverity Mark Cave-Ayland

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.