projects/linux·commit ea46c8f7

dynamic_debug: small cleanup in ddebug_proc_write()

ea46c8f7 · Dan Carpenter <[email protected]> · 2010-05-24 14:33:21 -07:00

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]>
Commit
ea46c8f774f295c45fac48101d54be347d3d453b
Parents
0fa05599

Changes

1 files changed · +1 −1

FileStatusAddDelContent
lib/dynamic_debug.cmodified+1−1View file

lib/dynamic_debug.c

View file
diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
index d6b8b9b..3df8eb1 100644
--- a/lib/dynamic_debug.c
+++ b/lib/dynamic_debug.c
@@ -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;