summaryrefslogtreecommitdiff
path: root/hw/sd/sdhci.c
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>2018-06-25 09:42:28 -0300
committerPaolo Bonzini <pbonzini@redhat.com>2018-07-02 15:41:16 +0200
commit4c8f9735da6111b9b1e52f12ee0ef4f481bc3b17 (patch)
treefa1a307083d7a0ac825f687e5bb3f19a842c0bab /hw/sd/sdhci.c
parent246e195b521b02860914754fd39f7809f96be67f (diff)
downloadqemu-4c8f9735da6111b9b1e52f12ee0ef4f481bc3b17.zip
hw/sd: Use the IEC binary prefix definitions
It eases code review, unit is explicit. Patch generated using: $ git grep -E '(1024|2048|4096|8192|(<<|>>).?(10|20|30))' hw/ include/hw/ and modified manually. Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20180625124238.25339-37-f4bug@amsat.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/sd/sdhci.c')
-rw-r--r--hw/sd/sdhci.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c
index c74025b2f4..8f58c31265 100644
--- a/hw/sd/sdhci.c
+++ b/hw/sd/sdhci.c
@@ -23,6 +23,7 @@
*/
#include "qemu/osdep.h"
+#include "qemu/units.h"
#include "qemu/error-report.h"
#include "qapi/error.h"
#include "hw/hw.h"
@@ -32,7 +33,6 @@
#include "hw/sd/sdhci.h"
#include "sdhci-internal.h"
#include "qemu/log.h"
-#include "qemu/cutils.h"
#include "trace.h"
#define TYPE_SDHCI_BUS "sdhci-bus"
@@ -737,7 +737,7 @@ static void get_adma_description(SDHCIState *s, ADMADescr *dscr)
if ((dscr->attr & SDHC_ADMA_ATTR_ACT_MASK) == SDHC_ADMA_ATTR_SET_LEN) {
dscr->length = (uint16_t)extract32(adma1, 12, 16);
} else {
- dscr->length = 4096;
+ dscr->length = 4 * KiB;
}
break;
case SDHC_CTRL_ADMA2_64:
@@ -785,7 +785,7 @@ static void sdhci_do_adma(SDHCIState *s)
return;
}
- length = dscr.length ? dscr.length : 65536;
+ length = dscr.length ? dscr.length : 64 * KiB;
switch (dscr.attr & SDHC_ADMA_ATTR_ACT_MASK) {
case SDHC_ADMA_ATTR_ACT_TRAN: /* data transfer */