mmc: sdhci: further code simplication
authorRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 26 Jan 2016 13:41:20 +0000 (13:41 +0000)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 29 Feb 2016 10:03:23 +0000 (11:03 +0100)
Further simplify the code in sdhci_prepare_data() - we don't set
SDHCI_REQ_USE_DMA anywhere else in the driver, so there is no
need to set it, and then immediately test it.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Tested-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/sdhci.c

index 2bd6bc1aca28e63ab24335df75882ef28795ea74..03fbb36580f7f3d696a3f2c9f5b69e48128af4ea 100644 (file)
@@ -725,21 +725,20 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_command *cmd)
        host->data_early = 0;
        host->data->bytes_xfered = 0;
 
-       if (host->flags & (SDHCI_USE_SDMA | SDHCI_USE_ADMA))
-               host->flags |= SDHCI_REQ_USE_DMA;
-
-       /*
-        * FIXME: This doesn't account for merging when mapping the
-        * scatterlist.
-        *
-        * The assumption here being that alignment and lengths are
-        * the same after DMA mapping to device address space.
-        */
-       if (host->flags & SDHCI_REQ_USE_DMA) {
+       if (host->flags & (SDHCI_USE_SDMA | SDHCI_USE_ADMA)) {
                struct scatterlist *sg;
                unsigned int length_mask, offset_mask;
                int i;
 
+               host->flags |= SDHCI_REQ_USE_DMA;
+
+               /*
+                * FIXME: This doesn't account for merging when mapping the
+                * scatterlist.
+                *
+                * The assumption here being that alignment and lengths are
+                * the same after DMA mapping to device address space.
+                */
                length_mask = 0;
                offset_mask = 0;
                if (host->flags & SDHCI_USE_ADMA) {