From: Russell King - ARM Linux Date: Mon, 3 Jan 2011 22:42:34 +0000 (+0000) Subject: ARM: PL08x: use min() to calculate target_len X-Git-Tag: firefly_0821_release~7613^2~2671^2~11^2~11 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d6cf7b597f7158616106068930d1c6203d9359eb;p=firefly-linux-kernel-4.4.55.git ARM: PL08x: use min() to calculate target_len Signed-off-by: Russell King Acked-by: Linus Walleij Signed-off-by: Dan Williams --- diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c index 7c327c315878..91dd6bfcc30f 100644 --- a/drivers/dma/amba-pl08x.c +++ b/drivers/dma/amba-pl08x.c @@ -682,9 +682,7 @@ static int pl08x_fill_llis_for_desc(struct pl08x_driver_data *pl08x, * If enough left try to send max possible, * otherwise try to send the remainder */ - target_len = remainder; - if (remainder > max_bytes_per_lli) - target_len = max_bytes_per_lli; + target_len = min(remainder, max_bytes_per_lli); /* * Set bus lengths for incrementing buses