[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 17/18] hw/sd: sdhci: Simplify updating s->prnsts in sdhci_sdma_tra
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 17/18] hw/sd: sdhci: Simplify updating s->prnsts in sdhci_sdma_transfer_multi_blocks() |
Date: |
Sat, 20 Feb 2021 01:13:08 +0100 |
From: Bin Meng <bmeng.cn@gmail.com>
s->prnsts is updated in both branches of the if () else () statement.
Move the common bits outside so that it is cleaner.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Alexander Bulekov <alxndr@bu.edu>
Reviewed-by: Alexander Bulekov <alxndr@bu.edu>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <1613447214-81951-5-git-send-email-bmeng.cn@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
hw/sd/sdhci.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c
index 8ffa53999d8..9acf4467a32 100644
--- a/hw/sd/sdhci.c
+++ b/hw/sd/sdhci.c
@@ -596,9 +596,9 @@ static void sdhci_sdma_transfer_multi_blocks(SDHCIState *s)
page_aligned = true;
}
+ s->prnsts |= SDHC_DATA_INHIBIT | SDHC_DAT_LINE_ACTIVE;
if (s->trnmod & SDHC_TRNS_READ) {
- s->prnsts |= SDHC_DOING_READ | SDHC_DATA_INHIBIT |
- SDHC_DAT_LINE_ACTIVE;
+ s->prnsts |= SDHC_DOING_READ;
while (s->blkcnt) {
if (s->data_count == 0) {
sdbus_read_data(&s->sdbus, s->fifo_buffer, block_size);
@@ -625,8 +625,7 @@ static void sdhci_sdma_transfer_multi_blocks(SDHCIState *s)
}
}
} else {
- s->prnsts |= SDHC_DOING_WRITE | SDHC_DATA_INHIBIT |
- SDHC_DAT_LINE_ACTIVE;
+ s->prnsts |= SDHC_DOING_WRITE;
while (s->blkcnt) {
begin = s->data_count;
if (((boundary_count + begin) < block_size) && page_aligned) {
--
2.26.2
- [PULL 07/18] hw/sd: ssi-sd: Fix SEND_IF_COND (CMD8) response, (continued)
- [PULL 07/18] hw/sd: ssi-sd: Fix SEND_IF_COND (CMD8) response, Philippe Mathieu-Daudé, 2021/02/19
- [PULL 08/18] hw/sd: ssi-sd: Fix STOP_TRANSMISSION (CMD12) response, Philippe Mathieu-Daudé, 2021/02/19
- [PULL 09/18] hw/sd: ssi-sd: Handle the rest commands with R1b response type, Philippe Mathieu-Daudé, 2021/02/19
- [PULL 10/18] hw/sd: sd: Fix address check in sd_erase(), Philippe Mathieu-Daudé, 2021/02/19
- [PULL 11/18] hw/sd: sd: Only SDSC cards support CMD28/29/30, Philippe Mathieu-Daudé, 2021/02/19
- [PULL 12/18] hw/sd: sd: Fix CMD30 response type, Philippe Mathieu-Daudé, 2021/02/19
- [PULL 13/18] hw/sd: sd: Move the sd_block_{read, write} and macros ahead, Philippe Mathieu-Daudé, 2021/02/19
- [PULL 14/18] hw/sd: sd: Skip write protect groups check in sd_erase() for high capacity cards, Philippe Mathieu-Daudé, 2021/02/19
- [PULL 15/18] hw/sd: sd: Skip write protect groups check in CMD24/25 for high capacity cards, Philippe Mathieu-Daudé, 2021/02/19
- [PULL 16/18] hw/sd: sd: Bypass the RCA check for CMD13 in SPI mode, Philippe Mathieu-Daudé, 2021/02/19
- [PULL 17/18] hw/sd: sdhci: Simplify updating s->prnsts in sdhci_sdma_transfer_multi_blocks(),
Philippe Mathieu-Daudé <=
- [PULL 18/18] MAINTAINERS: Add Bin Meng as co-maintainer for SD/MMC cards, Philippe Mathieu-Daudé, 2021/02/19
- Re: [PULL 00/18] SD/MMC patches for 2021-02-20, Peter Maydell, 2021/02/21