aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>2020-10-25 19:36:59 +0100
committerPhilippe Mathieu-Daudé <philmd@linaro.org>2024-06-24 10:41:42 +0200
commitf17fb69c55c7020b90cc1a9eaefe716902a5bc0e (patch)
tree963e6ec583b1b770719ec31346aee35657222c71
parent3dc5d349a32d741d3b432cc53f2ed518ff3c5f38 (diff)
downloadqemu-f17fb69c55c7020b90cc1a9eaefe716902a5bc0e.zip
qemu-f17fb69c55c7020b90cc1a9eaefe716902a5bc0e.tar.gz
qemu-f17fb69c55c7020b90cc1a9eaefe716902a5bc0e.tar.bz2
hw/sd/sdcard: Use HWBLOCK_SHIFT definition instead of magic values
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Cédric Le Goater <clg@redhat.com> Tested-by: Cédric Le Goater <clg@redhat.com> Message-Id: <20240621080554.18986-5-philmd@linaro.org>
-rw-r--r--hw/sd/sd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 72d7125..a14c5ff 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -596,7 +596,7 @@ static void sd_reset(DeviceState *dev)
} else {
sect = 0;
}
- size = sect << 9;
+ size = sect << HWBLOCK_SHIFT;
sect = sd_addr_to_wpnum(size) + 1;
@@ -822,8 +822,8 @@ static void sd_erase(SDState *sd)
if (FIELD_EX32(sd->ocr, OCR, CARD_CAPACITY)) {
/* High capacity memory card: erase units are 512 byte blocks */
- erase_start *= 512;
- erase_end *= 512;
+ erase_start <<= HWBLOCK_SHIFT;
+ erase_end <<= HWBLOCK_SHIFT;
sdsc = false;
}