Browse Source

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>
Russell King - ARM Linux 14 năm trước cách đây
mục cha
commit
d6cf7b597f
1 tập tin đã thay đổi với 1 bổ sung3 xóa
  1. 1 3
      drivers/dma/amba-pl08x.c

+ 1 - 3
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