aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/dynamic_debug.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
index dcdade39e47f..e487d1379298 100644
--- a/lib/dynamic_debug.c
+++ b/lib/dynamic_debug.c
@@ -187,7 +187,7 @@ static int ddebug_tokenize(char *buf, char *words[], int maxwords)
187 if (!*buf) 187 if (!*buf)
188 break; /* oh, it was trailing whitespace */ 188 break; /* oh, it was trailing whitespace */
189 189
190 /* Run `end' over a word, either whitespace separated or quoted */ 190 /* find `end' of word, whitespace separated or quoted */
191 if (*buf == '"' || *buf == '\'') { 191 if (*buf == '"' || *buf == '\'') {
192 int quote = *buf++; 192 int quote = *buf++;
193 for (end = buf ; *end && *end != quote ; end++) 193 for (end = buf ; *end && *end != quote ; end++)
@@ -199,8 +199,8 @@ static int ddebug_tokenize(char *buf, char *words[], int maxwords)
199 ; 199 ;
200 BUG_ON(end == buf); 200 BUG_ON(end == buf);
201 } 201 }
202 /* Here `buf' is the start of the word, `end' is one past the end */
203 202
203 /* `buf' is start of word, `end' is one past its end */
204 if (nwords == maxwords) 204 if (nwords == maxwords)
205 return -EINVAL; /* ran out of words[] before bytes */ 205 return -EINVAL; /* ran out of words[] before bytes */
206 if (*end) 206 if (*end)
@@ -452,7 +452,8 @@ static char *dynamic_emit_prefix(const struct _ddebug *desc, char *buf)
452 pos += snprintf(buf + pos, remaining(pos), "%s:", 452 pos += snprintf(buf + pos, remaining(pos), "%s:",
453 desc->function); 453 desc->function);
454 if (desc->flags & _DPRINTK_FLAGS_INCL_LINENO) 454 if (desc->flags & _DPRINTK_FLAGS_INCL_LINENO)
455 pos += snprintf(buf + pos, remaining(pos), "%d:", desc->lineno); 455 pos += snprintf(buf + pos, remaining(pos), "%d:",
456 desc->lineno);
456 if (pos - pos_after_tid) 457 if (pos - pos_after_tid)
457 pos += snprintf(buf + pos, remaining(pos), " "); 458 pos += snprintf(buf + pos, remaining(pos), " ");
458 if (pos >= PREFIX_SIZE) 459 if (pos >= PREFIX_SIZE)
@@ -708,10 +709,11 @@ static const struct seq_operations ddebug_proc_seqops = {
708}; 709};
709 710
710/* 711/*
711 * File_ops->open method for <debugfs>/dynamic_debug/control. Does the seq_file 712 * File_ops->open method for <debugfs>/dynamic_debug/control. Does
712 * setup dance, and also creates an iterator to walk the _ddebugs. 713 * the seq_file setup dance, and also creates an iterator to walk the
713 * Note that we create a seq_file always, even for O_WRONLY files 714 * _ddebugs. Note that we create a seq_file always, even for O_WRONLY
714 * where it's not needed, as doing so simplifies the ->release method. 715 * files where it's not needed, as doing so simplifies the ->release
716 * method.
715 */ 717 */
716static int ddebug_proc_open(struct inode *inode, struct file *file) 718static int ddebug_proc_open(struct inode *inode, struct file *file)
717{ 719{