[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 14/14] ppc4xx_sdram: Simplify sdram_ddr_size() to return
From: |
Markus Armbruster |
Subject: |
[PULL 14/14] ppc4xx_sdram: Simplify sdram_ddr_size() to return |
Date: |
Wed, 14 Dec 2022 17:46:29 +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 | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/hw/ppc/ppc4xx_sdram.c b/hw/ppc/ppc4xx_sdram.c
index 54bf9a2b44..a24c80b1d2 100644
--- a/hw/ppc/ppc4xx_sdram.c
+++ b/hw/ppc/ppc4xx_sdram.c
@@ -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)
--
2.37.3
- [PULL 00/14] Miscellaneous patches for 2022-12-14, Markus Armbruster, 2022/12/14
- [PULL 01/14] Drop more useless casts from void * to pointer, Markus Armbruster, 2022/12/14
- [PULL 05/14] monitor: Simplify monitor_fd_param()'s error handling, Markus Armbruster, 2022/12/14
- [PULL 09/14] sockets: Use ERRP_GUARD() where obviously appropriate, Markus Armbruster, 2022/12/14
- [PULL 10/14] qapi: Use returned bool to check for failure (again), Markus Armbruster, 2022/12/14
- [PULL 14/14] ppc4xx_sdram: Simplify sdram_ddr_size() to return,
Markus Armbruster <=
- [PULL 12/14] cleanup: Tweak and re-run return_directly.cocci, Markus Armbruster, 2022/12/14
- [PULL 04/14] error: Move ERRP_GUARD() to the beginning of the function, Markus Armbruster, 2022/12/14
- [PULL 02/14] error: Drop some obviously superfluous error_propagate(), Markus Armbruster, 2022/12/14
- [PULL 03/14] error: Drop a few superfluous ERRP_GUARD(), Markus Armbruster, 2022/12/14
- [PULL 08/14] qemu-config: Use ERRP_GUARD() where obviously appropriate, Markus Armbruster, 2022/12/14
- [PULL 11/14] io: Tidy up fat-fingered parameter name, Markus Armbruster, 2022/12/14
- [PULL 07/14] qemu-config: Make config_parse_qdict() return bool, Markus Armbruster, 2022/12/14
- [PULL 06/14] monitor: Use ERRP_GUARD() in monitor_init(), Markus Armbruster, 2022/12/14
- [PULL 13/14] block/vmdk: Simplify vmdk_co_create() to return directly, Markus Armbruster, 2022/12/14
- Re: [PULL 00/14] Miscellaneous patches for 2022-12-14, Peter Maydell, 2022/12/15