aboutsummaryrefslogtreecommitdiff
path: root/hw/sd/sd.c
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>2018-02-22 15:12:52 +0000
committerPeter Maydell <peter.maydell@linaro.org>2018-02-22 15:12:52 +0000
commit7af83490fe02e6ca4d97ef736e24d65a5fb1b1c1 (patch)
tree937b29ac693f99e2d6069293ecfcfe519482a381 /hw/sd/sd.c
parentf250015be6e208dbb9c45873ad7abb96ac893927 (diff)
downloadqemu-7af83490fe02e6ca4d97ef736e24d65a5fb1b1c1.zip
qemu-7af83490fe02e6ca4d97ef736e24d65a5fb1b1c1.tar.gz
qemu-7af83490fe02e6ca4d97ef736e24d65a5fb1b1c1.tar.bz2
sdcard: use G_BYTE from cutils
code is now easier to read. Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Alistair Francis <alistair.francis@xilinx.com> Message-id: 20180215220540.6556-11-f4bug@amsat.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/sd/sd.c')
-rw-r--r--hw/sd/sd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 90d1e27ee7..b3698e3 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -36,6 +36,7 @@
#include "hw/sd/sd.h"
#include "qapi/error.h"
#include "qemu/bitmap.h"
+#include "qemu/cutils.h"
#include "hw/qdev-properties.h"
#include "qemu/error-report.h"
#include "qemu/timer.h"
@@ -343,7 +344,7 @@ static void sd_set_csd(SDState *sd, uint64_t size)
uint32_t sectsize = (1 << (SECTOR_SHIFT + 1)) - 1;
uint32_t wpsize = (1 << (WPGROUP_SHIFT + 1)) - 1;
- if (size <= 0x40000000) { /* Standard Capacity SD */
+ if (size <= 1 * G_BYTE) { /* Standard Capacity SD */
sd->csd[0] = 0x00; /* CSD structure */
sd->csd[1] = 0x26; /* Data read access-time-1 */
sd->csd[2] = 0x00; /* Data read access-time-2 */