]> xenbits.xensource.com Git - qemu-upstream-4.5-testing.git/commitdiff
qxl: simplify qxl_rom_size
authorGerd Hoffmann <kraxel@redhat.com>
Wed, 11 Sep 2013 11:08:49 +0000 (13:08 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Wed, 18 Sep 2013 09:13:29 +0000 (11:13 +0200)
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 <kraxel@redhat.com>
hw/display/qxl.c

index f0bfd2cdf7738101eba5288fec158979d3dfc75b..bcbf97acebcafae9f4748a4861728ca76559e131 100644 (file)
@@ -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;
 }