From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: BALATON Zoltan <balaton@eik.bme.hu>
Subject: [PATCH 3/2] ppc4xx_sdram: Simplify sdram_ddr_size() to return
Date: Wed, 23 Nov 2022 08:06:50 +0100 [thread overview]
Message-ID: <87a64i87zp.fsf@pond.sub.org> (raw)
In-Reply-To: <20221122134917.1217307-1-armbru@redhat.com> (Markus Armbruster's message of "Tue, 22 Nov 2022 14:49:15 +0100")
Suggested-by: BALATON Zoltan <balaton@eik.bme.hu>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
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
next prev parent reply other threads:[~2022-11-23 7:07 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-22 13:49 [PATCH v2 0/2] cleanup: Tweak and re-run return_directly.cocci Markus Armbruster
2022-11-22 13:49 ` [Virtio-fs] " Markus Armbruster
2022-11-22 13:49 ` [PATCH v2 1/2] " Markus Armbruster
2022-11-22 13:49 ` [Virtio-fs] " Markus Armbruster
2022-11-22 14:06 ` BALATON Zoltan
2022-11-22 15:48 ` Markus Armbruster
2022-11-22 15:10 ` Philippe Mathieu-Daudé
2022-11-22 15:10 ` [Virtio-fs] " Philippe Mathieu-Daudé
2022-11-24 14:24 ` Dr. David Alan Gilbert
2022-11-24 14:24 ` [Virtio-fs] " Dr. David Alan Gilbert
2022-11-24 15:15 ` Greg Kurz
2022-11-24 15:15 ` [Virtio-fs] " Greg Kurz
2022-11-24 15:24 ` Greg Kurz
2022-11-24 15:24 ` [Virtio-fs] " Greg Kurz
2022-11-24 18:41 ` Markus Armbruster
2022-11-24 18:41 ` [Virtio-fs] " Markus Armbruster
2022-11-22 13:49 ` [PATCH v2 2/2] block/vmdk: Simplify vmdk_co_create() to return directly Markus Armbruster
2022-11-22 13:49 ` [Virtio-fs] " Markus Armbruster
2022-11-22 13:52 ` Peter Maydell
2022-11-22 13:52 ` [Virtio-fs] " Peter Maydell
2022-11-22 15:05 ` Philippe Mathieu-Daudé
2022-11-22 15:05 ` [Virtio-fs] " Philippe Mathieu-Daudé
2022-11-23 7:06 ` Markus Armbruster [this message]
2022-11-23 10:44 ` [PATCH 3/2] ppc4xx_sdram: Simplify sdram_ddr_size() to return BALATON Zoltan
2022-11-23 11:12 ` Markus Armbruster
2022-11-23 11:17 ` Philippe Mathieu-Daudé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87a64i87zp.fsf@pond.sub.org \
--to=armbru@redhat.com \
--cc=balaton@eik.bme.hu \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.