[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 01/13] cg3: remove TARGET_PAGE_SIZE rounding
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH v2 01/13] cg3: remove TARGET_PAGE_SIZE rounding on dirty page detection |
Date: |
Tue, 25 Apr 2017 15:57:07 +0100 |
On 21 April 2017 at 09:28, Mark Cave-Ayland
<address@hidden> wrote:
> This was an artifact from very early versions of the code from before the
> memory API and is no longer needed.
>
> Signed-off-by: Mark Cave-Ayland <address@hidden>
> Reviewed-by: Gerd Hoffmann <address@hidden>
> ---
> hw/display/cg3.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/hw/display/cg3.c b/hw/display/cg3.c
> index 1174220..7d43694 100644
> --- a/hw/display/cg3.c
> +++ b/hw/display/cg3.c
> @@ -26,7 +26,6 @@
> #include "qemu/osdep.h"
> #include "qapi/error.h"
> #include "qemu-common.h"
> -#include "cpu.h"
> #include "qemu/error-report.h"
> #include "ui/console.h"
> #include "hw/sysbus.h"
> @@ -114,7 +113,7 @@ static void cg3_update_display(void *opaque)
> for (y = 0; y < height; y++) {
> int update = s->full_update;
>
> - page = (y * width) & TARGET_PAGE_MASK;
> + page = y * width;
Coverity warns that this is multiplying two 32 bit quantities
and giving a 32 bit result that's then assigned to a 64 bit variable.
Casting like:
page = (ram_addr_t)y * width;
is the usual way to placate it.
thanks
-- PMM
- [Qemu-devel] [PATCH v2 00/13] TCX/CG3 adapter cleanups, Mark Cave-Ayland, 2017/04/21
- [Qemu-devel] [PATCH v2 09/13] tcx: remove TARGET_PAGE_SIZE from tcx_update_display(), Mark Cave-Ayland, 2017/04/21
- [Qemu-devel] [PATCH v2 08/13] tcx: remove page24 and cpage from tcx24_update_display(), Mark Cave-Ayland, 2017/04/21
- [Qemu-devel] [PATCH v2 02/13] cg3: fix up size parameter for memory_region_get_dirty(), Mark Cave-Ayland, 2017/04/21
- [Qemu-devel] [PATCH v2 06/13] tcx: alter tcx24_check_dirty() to accept address and length parameters, Mark Cave-Ayland, 2017/04/21
- [Qemu-devel] [PATCH v2 04/13] tcx: alter tcx_set_dirty() to accept address and length parameters, Mark Cave-Ayland, 2017/04/21
- [Qemu-devel] [PATCH v2 05/13] tcx: ensure tcx_set_dirty() also invalidates the 24-bit plane and cplane, Mark Cave-Ayland, 2017/04/21
- [Qemu-devel] [PATCH v2 07/13] tcx: alter tcx24_reset_dirty() to accept address and length parameters, Mark Cave-Ayland, 2017/04/21
- [Qemu-devel] [PATCH v2 01/13] cg3: remove TARGET_PAGE_SIZE rounding on dirty page detection, Mark Cave-Ayland, 2017/04/21
- Re: [Qemu-devel] [PATCH v2 01/13] cg3: remove TARGET_PAGE_SIZE rounding on dirty page detection,
Peter Maydell <=
- [Qemu-devel] [PATCH v2 03/13] cg3: switch to load_image_mr() and remove prom-addr hack, Mark Cave-Ayland, 2017/04/21
- [Qemu-devel] [PATCH v2 11/13] tcx: remove primitives for non-32-bit surfaces, Mark Cave-Ayland, 2017/04/21
- [Qemu-devel] [PATCH v2 10/13] tcx: remove TARGET_PAGE_SIZE from tcx24_update_display(), Mark Cave-Ayland, 2017/04/21
- [Qemu-devel] [PATCH v2 12/13] tcx: use tcx_set_dirty() for accelerated ops, Mark Cave-Ayland, 2017/04/21
- [Qemu-devel] [PATCH v2 13/13] tcx: switch to load_image_mr() and remove prom_addr hack, Mark Cave-Ayland, 2017/04/21