]> git.proxmox.com Git - mirror_qemu.git/commitdiff
ppc4xx_sdram: Simplify sdram_ddr_size() to return
authorMarkus Armbruster <armbru@redhat.com>
Wed, 23 Nov 2022 07:06:50 +0000 (08:06 +0100)
committerMarkus Armbruster <armbru@redhat.com>
Wed, 14 Dec 2022 15:19:35 +0000 (16:19 +0100)
Suggested-by: BALATON Zoltan <balaton@eik.bme.hu>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <87a64i87zp.fsf@pond.sub.org>
Reviewed-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
hw/ppc/ppc4xx_sdram.c

index 54bf9a2b4494cc876bb9277acd69856a03942bf2..a24c80b1d2ac28d6471f0f256b9e03710e35bfcd 100644 (file)
@@ -192,17 +192,13 @@ static inline hwaddr sdram_ddr_base(uint32_t bcr)
 
 static hwaddr sdram_ddr_size(uint32_t bcr)
 {
-    hwaddr size;
-    int sh;
+    int sh = (bcr >> 17) & 0x7;
 
-    sh = (bcr >> 17) & 0x7;
     if (sh == 7) {
-        size = -1;
-    } else {
-        size = (4 * MiB) << sh;
+        return -1;
     }
 
-    return size;
+    return (4 * MiB) << sh;
 }
 
 static uint32_t sdram_ddr_dcr_read(void *opaque, int dcrn)