[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v7 07/17] hw/sd/sdcard: Move sd->size initialization
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v7 07/17] hw/sd/sdcard: Move sd->size initialization |
Date: |
Tue, 30 Jun 2020 15:39:01 +0200 |
Move sd->size initialization earlier to make the following
patches easier to review.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
hw/sd/sd.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 871c30a67f..078b0e81ee 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -558,12 +558,13 @@ static void sd_reset(DeviceState *dev)
sect = sd_addr_to_wpnum(size) + 1;
+ sd->size = size;
sd->state = sd_idle_state;
sd->rca = 0x0000;
sd_set_ocr(sd);
sd_set_scr(sd);
sd_set_cid(sd);
- sd_set_csd(sd, size);
+ sd_set_csd(sd, sd->size);
sd_set_cardstatus(sd);
sd_set_sdstatus(sd);
@@ -574,7 +575,6 @@ static void sd_reset(DeviceState *dev)
memset(sd->function_group, 0, sizeof(sd->function_group));
sd->erase_start = 0;
sd->erase_end = 0;
- sd->size = size;
sd->blk_len = HWBLOCK_SIZE;
sd->pwd_len = 0;
sd->expecting_acmd = false;
--
2.21.3
- [PATCH v7 00/17] hw/sd/sdcard: Fix CVE-2020-13253 & cleanups, Philippe Mathieu-Daudé, 2020/06/30
- [PATCH v7 01/17] MAINTAINERS: Cc qemu-block mailing list, Philippe Mathieu-Daudé, 2020/06/30
- [PATCH v7 02/17] hw/sd/sdcard: Update coding style to make checkpatch.pl happy, Philippe Mathieu-Daudé, 2020/06/30
- [PATCH v7 03/17] hw/sd/sdcard: Move some definitions to use them earlier, Philippe Mathieu-Daudé, 2020/06/30
- [PATCH v7 04/17] hw/sd/sdcard: Use the HWBLOCK_SIZE definition, Philippe Mathieu-Daudé, 2020/06/30
- [PATCH v7 05/17] hw/sd/sdcard: Do not switch to ReceivingData if address is invalid, Philippe Mathieu-Daudé, 2020/06/30
- [PATCH v7 06/17] hw/sd/sdcard: Restrict Class 6 commands to SCSD cards, Philippe Mathieu-Daudé, 2020/06/30
- [PATCH v7 07/17] hw/sd/sdcard: Move sd->size initialization,
Philippe Mathieu-Daudé <=
- [PATCH v7 08/17] hw/sd/sdcard: Call sd_addr_to_wpnum where it is used, consider zero size, Philippe Mathieu-Daudé, 2020/06/30
- [PATCH v7 09/17] hw/sd/sdcard: Special case the -ENOMEDIUM error, Philippe Mathieu-Daudé, 2020/06/30
- [PATCH v7 10/17] hw/sd/sdcard: Check address is in range, Philippe Mathieu-Daudé, 2020/06/30
- [PATCH v7 14/17] hw/sd/sdcard: Make iolen unsigned, Philippe Mathieu-Daudé, 2020/06/30
- [PATCH v7 11/17] hw/sd/sdcard: Update the SDState documentation, Philippe Mathieu-Daudé, 2020/06/30
- [PATCH v7 12/17] hw/sd/sdcard: Simplify cmd_valid_while_locked(), Philippe Mathieu-Daudé, 2020/06/30
- [PATCH v7 13/17] hw/sd/sdcard: Constify sd_crc*()'s message argument, Philippe Mathieu-Daudé, 2020/06/30
- [PATCH v7 17/17] hw/sd/sdcard: Simplify realize() a bit, Philippe Mathieu-Daudé, 2020/06/30
- [PATCH v7 16/17] hw/sd/sdcard: Display offset in read/write_data() trace events, Philippe Mathieu-Daudé, 2020/06/30
- [PATCH v7 15/17] hw/sd/sdcard: Correctly display the command name in trace events, Philippe Mathieu-Daudé, 2020/06/30