提交 267e2a9c 编写于 作者: A Arjan van de Ven 提交者: Linus Torvalds

Use WARN() in fs/proc/

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: NArjan van de Ven <arjan@linux.intel.com>
Acked-by: NAlexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 99fcd77d
......@@ -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);
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册