Skip to contentSkip to conversation

dynamic_debug: small clean up in ddebug_proc_write()

PATCH In review Dan Carpenter 2 participants 2 messages Mar 6, 2010 – Mar 8, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dynamic_debug: small clean up in ddebug_proc_write()

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.

lib/dynamic_debug.c +1 -1
index f935029..4482f9d 100644
@@ -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;