Skip to content

Commit

Permalink
Use WARN() in fs/proc/
Browse files Browse the repository at this point in the history
Use WARN() instead of a printk+WARN_ON() pair; this way the message
becomes part of the warning section for better reporting/collection.
This way, the entire if() {} section can collapse into the WARN() as well.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Acked-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Arjan van de Ven authored and Linus Torvalds committed Jul 26, 2008
1 parent 99fcd77 commit 267e2a9
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions fs/proc/generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -806,12 +806,9 @@ void remove_proc_entry(const char *name, struct proc_dir_entry *parent)
if (S_ISDIR(de->mode))
parent->nlink--;
de->nlink = 0;
if (de->subdir) {
printk(KERN_WARNING "%s: removing non-empty directory "
WARN(de->subdir, KERN_WARNING "%s: removing non-empty directory "
"'%s/%s', leaking at least '%s'\n", __func__,
de->parent->name, de->name, de->subdir->name);
WARN_ON(1);
}
if (atomic_dec_and_test(&de->count))
free_proc_entry(de);
}

0 comments on commit 267e2a9

Please sign in to comment.