From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754680AbdKIVws (ORCPT ); Thu, 9 Nov 2017 16:52:48 -0500 Received: from bombadil.infradead.org ([65.50.211.133]:46905 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751017AbdKIVwo (ORCPT ); Thu, 9 Nov 2017 16:52:44 -0500 To: LKML , Andrew Morton , Jason Baron From: Randy Dunlap Subject: [PATCH 1/2] dynamic_debug: fix optional/omitted ending line number to be LARGE instead of 0 Message-ID: <10a6a101-e2be-209f-1f41-54637824788e@infradead.org> Date: Thu, 9 Nov 2017 13:52:41 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Randy Dunlap 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 Cc: Jason Baron --- 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,