dynamic_debug: small cleanup in ddebug_proc_write()
authorDan Carpenter <[email protected]>
Mon, 24 May 2010 21:33:21 +0000 (14:33 -0700)
committerLinus Torvalds <[email protected]>
Tue, 25 May 2010 15:07:05 +0000 (08:07 -0700)
This 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 <[email protected]>
Acked-by: Jason Baron <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
lib/dynamic_debug.c

index d6b8b9b1abfedf5ca023164b76d81ca06d0622a2..3df8eb17a607932bf8091e89c796c338c323c29b 100644 (file)
@@ -456,7 +456,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;