All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] dynamic_debug: fix optional/omitted ending line number to be LARGE instead of 0
@ 2017-11-09 21:52 Randy Dunlap
  2017-11-10 21:44 ` Jason Baron
  0 siblings, 1 reply; 2+ messages in thread
From: Randy Dunlap @ 2017-11-09 21:52 UTC (permalink / raw)
  To: LKML, Andrew Morton, Jason Baron

From: Randy Dunlap <rdunlap@infradead.org>

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

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Jason Baron <jbaron@akamai.com>
---
 lib/dynamic_debug.c |    4 ++++
 1 file changed, 4 insertions(+)

--- lnx-414-rc8.orig/lib/dynamic_debug.c
+++ lnx-414-rc8/lib/dynamic_debug.c
@@ -360,6 +360,10 @@ static int ddebug_parse_query(char *word
 				if (parse_lineno(last, &query->last_lineno) < 0)
 					return -EINVAL;
 
+				/* special case for last lineno not specified */
+				if (query->last_lineno == 0)
+					query->last_lineno = UINT_MAX;
+
 				if (query->last_lineno < query->first_lineno) {
 					pr_err("last-line:%d < 1st-line:%d\n",
 						query->last_lineno,

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/2] dynamic_debug: fix optional/omitted ending line number to be LARGE instead of 0
  2017-11-09 21:52 [PATCH 1/2] dynamic_debug: fix optional/omitted ending line number to be LARGE instead of 0 Randy Dunlap
@ 2017-11-10 21:44 ` Jason Baron
  0 siblings, 0 replies; 2+ messages in thread
From: Jason Baron @ 2017-11-10 21:44 UTC (permalink / raw)
  To: Randy Dunlap, LKML, Andrew Morton

On 11/09/2017 04:52 PM, Randy Dunlap wrote:
> From: Randy Dunlap <rdunlap@infradead.org>
> 
> 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
> 
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: Jason Baron <jbaron@akamai.com>
> ---
>  lib/dynamic_debug.c |    4 ++++
>  1 file changed, 4 insertions(+)
> 
> --- lnx-414-rc8.orig/lib/dynamic_debug.c
> +++ lnx-414-rc8/lib/dynamic_debug.c
> @@ -360,6 +360,10 @@ static int ddebug_parse_query(char *word
>  				if (parse_lineno(last, &query->last_lineno) < 0)
>  					return -EINVAL;
>  
> +				/* special case for last lineno not specified */
> +				if (query->last_lineno == 0)
> +					query->last_lineno = UINT_MAX;
> +
>  				if (query->last_lineno < query->first_lineno) {
>  					pr_err("last-line:%d < 1st-line:%d\n",
>  						query->last_lineno,
> 

Acked-by: Jason Baron <jbaron@akamai.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-11-10 21:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-09 21:52 [PATCH 1/2] dynamic_debug: fix optional/omitted ending line number to be LARGE instead of 0 Randy Dunlap
2017-11-10 21:44 ` Jason Baron

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.