From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42154) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMahV-000490-V0 for qemu-devel@nongnu.org; Thu, 19 Sep 2013 05:39:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VMahP-0003Xc-Sj for qemu-devel@nongnu.org; Thu, 19 Sep 2013 05:39:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:14665) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMahP-0003XE-KJ for qemu-devel@nongnu.org; Thu, 19 Sep 2013 05:38:59 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r8J9cwSf029217 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 19 Sep 2013 05:38:59 -0400 From: Gerd Hoffmann Date: Thu, 19 Sep 2013 11:38:52 +0200 Message-Id: <1379583534-7831-3-git-send-email-kraxel@redhat.com> In-Reply-To: <1379583534-7831-1-git-send-email-kraxel@redhat.com> References: <1379583534-7831-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 2/4] qxl: simplify qxl_rom_size List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann Nowdays rom size is fixed at 8192 for live migration compat reasons. So we can ditch the pointless math trying to calculate the size needed. Also make the size sanity check fail at compile time not runtime. Signed-off-by: Gerd Hoffmann --- hw/display/qxl.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/display/qxl.c b/hw/display/qxl.c index f0bfd2c..bcbf97a 100644 --- a/hw/display/qxl.c +++ b/hw/display/qxl.c @@ -313,9 +313,7 @@ static ram_addr_t qxl_rom_size(void) sizeof(qxl_modes); uint32_t rom_size = 8192; /* two pages */ - required_rom_size = MAX(required_rom_size, TARGET_PAGE_SIZE); - required_rom_size = msb_mask(required_rom_size * 2 - 1); - assert(required_rom_size <= rom_size); + QEMU_BUILD_BUG_ON(required_rom_size > rom_size); return rom_size; } -- 1.8.3.1