From patchwork Sun Oct 7 15:03:35 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alon Levy X-Patchwork-Id: 189842 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 3263E2C0313 for ; Mon, 8 Oct 2012 02:03:53 +1100 (EST) Received: from localhost ([::1]:57983 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TKsOU-0005HY-K7 for incoming@patchwork.ozlabs.org; Sun, 07 Oct 2012 11:03:50 -0400 Received: from eggs.gnu.org ([208.118.235.92]:40999) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TKsOO-0005GR-L8 for qemu-devel@nongnu.org; Sun, 07 Oct 2012 11:03:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TKsON-00085u-Qa for qemu-devel@nongnu.org; Sun, 07 Oct 2012 11:03:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55226) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TKsON-00085q-Ib for qemu-devel@nongnu.org; Sun, 07 Oct 2012 11:03:43 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q97F3gE3016417 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 7 Oct 2012 11:03:42 -0400 Received: from garlic.redhat.com (vpn1-6-161.ams2.redhat.com [10.36.6.161]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q97F3aBk021980; Sun, 7 Oct 2012 11:03:37 -0400 From: Alon Levy To: qemu-devel@nongnu.org, kraxel@redhat.com Date: Sun, 7 Oct 2012 17:03:35 +0200 Message-Id: <1349622215-15950-1-git-send-email-alevy@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] hw/qxl: qxl_dirty_surfaces: use uintptr_t X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org As suggested by Paolo Bonzini, to avoid possible integer overflow issues. Signed-off-by: Alon Levy --- hw/qxl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/qxl.c b/hw/qxl.c index 4effb66..97ae22a 100644 --- a/hw/qxl.c +++ b/hw/qxl.c @@ -1811,7 +1811,7 @@ static void qxl_hw_text_update(void *opaque, console_ch_t *chardata) static void qxl_dirty_surfaces(PCIQXLDevice *qxl) { - intptr_t vram_start; + uintptr_t vram_start; int i; if (qxl->mode != QXL_MODE_NATIVE && qxl->mode != QXL_MODE_COMPAT) { @@ -1822,7 +1822,7 @@ static void qxl_dirty_surfaces(PCIQXLDevice *qxl) qxl_set_dirty(&qxl->vga.vram, qxl->shadow_rom.draw_area_offset, qxl->shadow_rom.surface0_area_size); - vram_start = (intptr_t)memory_region_get_ram_ptr(&qxl->vram_bar); + vram_start = (uintptr_t)memory_region_get_ram_ptr(&qxl->vram_bar); /* dirty the off-screen surfaces */ for (i = 0; i < qxl->ssd.num_surfaces; i++) {