diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/dma/dmatest.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c index d19234b08342..4225a292d371 100644 --- a/drivers/dma/dmatest.c +++ b/drivers/dma/dmatest.c | |||
@@ -66,6 +66,9 @@ module_param(timeout, uint, S_IRUGO); | |||
66 | MODULE_PARM_DESC(timeout, "Transfer Timeout in msec (default: 3000), " | 66 | MODULE_PARM_DESC(timeout, "Transfer Timeout in msec (default: 3000), " |
67 | "Pass -1 for infinite timeout"); | 67 | "Pass -1 for infinite timeout"); |
68 | 68 | ||
69 | /* Maximum amount of mismatched bytes in buffer to print */ | ||
70 | #define MAX_ERROR_COUNT 32 | ||
71 | |||
69 | /* | 72 | /* |
70 | * Initialization patterns. All bytes in the source buffer has bit 7 | 73 | * Initialization patterns. All bytes in the source buffer has bit 7 |
71 | * set, all bytes in the destination buffer has bit 7 cleared. | 74 | * set, all bytes in the destination buffer has bit 7 cleared. |
@@ -249,7 +252,7 @@ static unsigned int dmatest_verify(u8 **bufs, unsigned int start, | |||
249 | actual = buf[i]; | 252 | actual = buf[i]; |
250 | expected = pattern | (~counter & PATTERN_COUNT_MASK); | 253 | expected = pattern | (~counter & PATTERN_COUNT_MASK); |
251 | if (actual != expected) { | 254 | if (actual != expected) { |
252 | if (error_count < 32) | 255 | if (error_count < MAX_ERROR_COUNT) |
253 | dmatest_mismatch(actual, pattern, i, | 256 | dmatest_mismatch(actual, pattern, i, |
254 | counter, is_srcbuf); | 257 | counter, is_srcbuf); |
255 | error_count++; | 258 | error_count++; |
@@ -258,9 +261,9 @@ static unsigned int dmatest_verify(u8 **bufs, unsigned int start, | |||
258 | } | 261 | } |
259 | } | 262 | } |
260 | 263 | ||
261 | if (error_count > 32) | 264 | if (error_count > MAX_ERROR_COUNT) |
262 | pr_warning("%s: %u errors suppressed\n", | 265 | pr_warning("%s: %u errors suppressed\n", |
263 | current->comm, error_count - 32); | 266 | current->comm, error_count - MAX_ERROR_COUNT); |
264 | 267 | ||
265 | return error_count; | 268 | return error_count; |
266 | } | 269 | } |