mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
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>
This commit is contained in:
parent
3dc5d349a3
commit
f17fb69c55
1 changed files with 3 additions and 3 deletions
|
@ -596,7 +596,7 @@ static void sd_reset(DeviceState *dev)
|
||||||
} else {
|
} else {
|
||||||
sect = 0;
|
sect = 0;
|
||||||
}
|
}
|
||||||
size = sect << 9;
|
size = sect << HWBLOCK_SHIFT;
|
||||||
|
|
||||||
sect = sd_addr_to_wpnum(size) + 1;
|
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)) {
|
if (FIELD_EX32(sd->ocr, OCR, CARD_CAPACITY)) {
|
||||||
/* High capacity memory card: erase units are 512 byte blocks */
|
/* High capacity memory card: erase units are 512 byte blocks */
|
||||||
erase_start *= 512;
|
erase_start <<= HWBLOCK_SHIFT;
|
||||||
erase_end *= 512;
|
erase_end <<= HWBLOCK_SHIFT;
|
||||||
sdsc = false;
|
sdsc = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue