aboutsummaryrefslogtreecommitdiff
path: root/hw/sd
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>2018-06-25 09:41:57 -0300
committerPaolo Bonzini <pbonzini@redhat.com>2018-07-02 15:41:10 +0200
commitd23b6caadbfaf56092593e8ff22fb5797db38488 (patch)
tree2c73a6ed5040c12b2968540dddb81da57e174765 /hw/sd
parent5fa96cad01bf408064aeea19812c0692ddfbd2b6 (diff)
downloadqemu-d23b6caadbfaf56092593e8ff22fb5797db38488.zip
qemu-d23b6caadbfaf56092593e8ff22fb5797db38488.tar.gz
qemu-d23b6caadbfaf56092593e8ff22fb5797db38488.tar.bz2
hw: Use IEC binary prefix definitions from "qemu/units.h"
Code change produced with: $ git ls-files | egrep '\.[ch]$' | \ xargs sed -i -e 's/\(\W[KMGTPE]\)_BYTE/\1iB/g' Suggested-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Acked-by: David Gibson <david@gibson.dropbear.id.au> (ppc parts) Message-Id: <20180625124238.25339-6-f4bug@amsat.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/sd')
-rw-r--r--hw/sd/sd.c4
-rw-r--r--hw/sd/sdhci.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 540bccb..9a16b76 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -305,7 +305,7 @@ static void sd_ocr_powerup(void *opaque)
/* card power-up OK */
sd->ocr = FIELD_DP32(sd->ocr, OCR, CARD_POWER_UP, 1);
- if (sd->size > 1 * G_BYTE) {
+ if (sd->size > 1 * GiB) {
sd->ocr = FIELD_DP32(sd->ocr, OCR, CARD_CAPACITY, 1);
}
}
@@ -377,7 +377,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 <= 1 * G_BYTE) { /* Standard Capacity SD */
+ if (size <= 1 * GiB) { /* 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 */
diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c
index 321d02d..c74025b 100644
--- a/hw/sd/sdhci.c
+++ b/hw/sd/sdhci.c
@@ -409,7 +409,7 @@ static void sdhci_end_transfer(SDHCIState *s)
/*
* Programmed i/o data transfer
*/
-#define BLOCK_SIZE_MASK (4 * K_BYTE - 1)
+#define BLOCK_SIZE_MASK (4 * KiB - 1)
/* Fill host controller's read buffer with BLKSIZE bytes of data from card */
static void sdhci_read_block_from_card(SDHCIState *s)