summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell King - ARM Linux2011-01-03 23:42:34 +0100
committerDan Williams2011-01-05 04:16:13 +0100
commitd6cf7b597f7158616106068930d1c6203d9359eb (patch)
treea1d640957f21926f2f65e96804ecd18f72047413
parentARM: PL08x: ensure pl08x_pre_boundary() works for any value of addr (diff)
downloadkernel-qcow2-linux-d6cf7b597f7158616106068930d1c6203d9359eb.tar.gz
kernel-qcow2-linux-d6cf7b597f7158616106068930d1c6203d9359eb.tar.xz
kernel-qcow2-linux-d6cf7b597f7158616106068930d1c6203d9359eb.zip
ARM: PL08x: use min() to calculate target_len
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
-rw-r--r--drivers/dma/amba-pl08x.c4
1 files changed, 1 insertions, 3 deletions
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