public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] dynamic_debug: small clean up in ddebug_proc_write()
@ 2010-03-06 10:59 Dan Carpenter
  2010-03-08 15:51 ` Jason Baron
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2010-03-06 10:59 UTC (permalink / raw)
  To: Jason Baron
  Cc: Greg Kroah-Hartman, Andrew Morton, Greg Banks,
	André Goddard Rosa, linux-kernel, kernel-janitors

This the doesn't change behavior at all.  In the original code, if nwords
was zero then ddebug_parse_query() would return -EINVAL, now we just do 
it earlier.

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
index f935029..4482f9d 100644
--- a/lib/dynamic_debug.c
+++ b/lib/dynamic_debug.c
@@ -455,7 +455,7 @@ static ssize_t ddebug_proc_write(struct file *file, const char __user *ubuf,
 			__func__, (int)len);
 
 	nwords = ddebug_tokenize(tmpbuf, words, MAXWORDS);
-	if (nwords < 0)
+	if (nwords <= 0)
 		return -EINVAL;
 	if (ddebug_parse_query(words, nwords-1, &query))
 		return -EINVAL;

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

* Re: [patch] dynamic_debug: small clean up in ddebug_proc_write()
  2010-03-06 10:59 [patch] dynamic_debug: small clean up in ddebug_proc_write() Dan Carpenter
@ 2010-03-08 15:51 ` Jason Baron
  0 siblings, 0 replies; 2+ messages in thread
From: Jason Baron @ 2010-03-08 15:51 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Greg Kroah-Hartman, Andrew Morton, Greg Banks,
	André Goddard Rosa, linux-kernel, kernel-janitors

On Sat, Mar 06, 2010 at 01:59:34PM +0300, Dan Carpenter wrote:
> This the doesn't change behavior at all.  In the original code, if nwords
> was zero then ddebug_parse_query() would return -EINVAL, now we just do 
> it earlier.
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> 

I guess it makes the code a little more readable.

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

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

end of thread, other threads:[~2010-03-08 15:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-06 10:59 [patch] dynamic_debug: small clean up in ddebug_proc_write() Dan Carpenter
2010-03-08 15:51 ` Jason Baron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox