diff options
author | Randy Dunlap <rdunlap@infradead.org> | 2017-11-17 18:27:35 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-11-17 19:10:01 -0500 |
commit | 1f3c790bd5989fcfec9e53ad8fa09f5b740c958f (patch) | |
tree | 3a8f96501943d7d4a6828416163c81e55bb2ef18 /lib/dynamic_debug.c | |
parent | 8c703d660450c4df72ff24f79a335dc7973a9dc8 (diff) |
dynamic-debug-howto: fix optional/omitted ending line number to be LARGE instead of 0
line-range is supposed to treat "1-" as "1-endoffile", so
handle the special case by setting last_lineno to UINT_MAX.
Fixes this error:
dynamic_debug:ddebug_parse_query: last-line:0 < 1st-line:1
dynamic_debug:ddebug_exec_query: query parse failed
Link: http://lkml.kernel.org/r/10a6a101-e2be-209f-1f41-54637824788e@infradead.org
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Acked-by: Jason Baron <jbaron@akamai.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'lib/dynamic_debug.c')
-rw-r--r-- | lib/dynamic_debug.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index da796e2dc4f5..c7c96bc7654a 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c | |||
@@ -360,6 +360,10 @@ static int ddebug_parse_query(char *words[], int nwords, | |||
360 | if (parse_lineno(last, &query->last_lineno) < 0) | 360 | if (parse_lineno(last, &query->last_lineno) < 0) |
361 | return -EINVAL; | 361 | return -EINVAL; |
362 | 362 | ||
363 | /* special case for last lineno not specified */ | ||
364 | if (query->last_lineno == 0) | ||
365 | query->last_lineno = UINT_MAX; | ||
366 | |||
363 | if (query->last_lineno < query->first_lineno) { | 367 | if (query->last_lineno < query->first_lineno) { |
364 | pr_err("last-line:%d < 1st-line:%d\n", | 368 | pr_err("last-line:%d < 1st-line:%d\n", |
365 | query->last_lineno, | 369 | query->last_lineno, |