[PATCH 5/6] mmc: bcm2835: simplify burst words calculation

Stefan Wahren stefan.wahren at i2se.com
Sat Feb 11 14:48:35 PST 2017


Signed-off-by: Stefan Wahren <stefan.wahren at i2se.com>
---
 drivers/mmc/host/bcm2835.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/mmc/host/bcm2835.c b/drivers/mmc/host/bcm2835.c
index e5ccf6d..4a04918 100644
--- a/drivers/mmc/host/bcm2835.c
+++ b/drivers/mmc/host/bcm2835.c
@@ -375,9 +375,7 @@ static void bcm2835_transfer_block_pio(struct bcm2835_host *host, bool is_read)
 			int burst_words, words;
 			u32 edm;
 
-			burst_words = SDDATA_FIFO_PIO_BURST;
-			if (burst_words > copy_words)
-				burst_words = copy_words;
+			burst_words = min(SDDATA_FIFO_PIO_BURST, copy_words);
 			edm = readl(host->ioaddr + SDEDM);
 			if (is_read)
 				words = ((edm >> 4) & 0x1f);
-- 
1.7.9.5




More information about the linux-rpi-kernel mailing list