aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/mt7621-mmc
diff options
context:
space:
mode:
authorChristian Lütke-Stetzkamp <christian@lkamp.de>2018-04-24 20:01:23 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-04-25 15:36:19 +0200
commit05e41c96a6deab303f8cf652a5ade253f6f1a2ca (patch)
treeab0b078b33dcf07cd53bb0f1bce5950ba6145255 /drivers/staging/mt7621-mmc
parentstaging: mt7621-mmc: Fix dereference before check in msdc_drv_pm (diff)
downloadlinux-dev-05e41c96a6deab303f8cf652a5ade253f6f1a2ca.tar.xz
linux-dev-05e41c96a6deab303f8cf652a5ade253f6f1a2ca.zip
staging: mt7621-mmc: Remove multiple assignments
Fix checkpatch: multiple assignments should be avoided, to improve readability. It aslo moves the second assignment out of the if/else block, that is valid, because drv_mode is of type msdc_mode, an enum with only those three elements, so one of the if/ else if statements is always taken. And the second assignment can happen after the conditions. Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Reviewed-by: NeilBrown <neil@brown.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/mt7621-mmc')
-rw-r--r--drivers/staging/mt7621-mmc/sd.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c
index a3e2c9769591..d464e2a321da 100644
--- a/drivers/staging/mt7621-mmc/sd.c
+++ b/drivers/staging/mt7621-mmc/sd.c
@@ -1397,11 +1397,12 @@ static int msdc_do_request(struct mmc_host *mmc, struct mmc_request *mrq)
/* deside the transfer mode */
if (drv_mode[host->id] == MODE_PIO)
- host->dma_xfer = dma = 0;
+ host->dma_xfer = 0;
else if (drv_mode[host->id] == MODE_DMA)
- host->dma_xfer = dma = 1;
+ host->dma_xfer = 1;
else if (drv_mode[host->id] == MODE_SIZE_DEP)
- host->dma_xfer = dma = ((host->xfer_size >= dma_size[host->id]) ? 1 : 0);
+ host->dma_xfer = ((host->xfer_size >= dma_size[host->id]) ? 1 : 0);
+ dma = host->dma_xfer;
if (read) {
if ((host->timeout_ns != data->timeout_ns) ||