diff options
| author | Bin Meng <bmeng.cn@gmail.com> | 2021-02-16 11:46:52 +0800 |
|---|---|---|
| committer | Philippe Mathieu-Daudé <f4bug@amsat.org> | 2021-02-20 00:19:13 +0100 |
| commit | 8bc1f1aa51d32c3184e7b19d5b94c35ecc06f056 (patch) | |
| tree | d8197ddc8a7f958faafb424b2947abe37f0e93d6 /hw/sd/sdhci.c | |
| parent | c557e08d9c9729cdf6b98f7a9c1ebf72fa25e916 (diff) | |
| download | focaccia-qemu-8bc1f1aa51d32c3184e7b19d5b94c35ecc06f056.tar.gz focaccia-qemu-8bc1f1aa51d32c3184e7b19d5b94c35ecc06f056.zip | |
hw/sd: sdhci: Simplify updating s->prnsts in sdhci_sdma_transfer_multi_blocks()
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>
Diffstat (limited to 'hw/sd/sdhci.c')
| -rw-r--r-- | hw/sd/sdhci.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c index 8ffa53999d..9acf4467a3 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) { |