From: Arjan van de Ven Date: Sat, 26 Jul 2008 02:45:41 +0000 (-0700) Subject: Use WARN() in fs/proc/ X-Git-Tag: v2.6.27-rc1~143 X-Git-Url: http://ftp.safe.ca/?p=safe%2Fjmp%2Flinux-2.6;a=commitdiff_plain;h=267e2a9c71b8e088ac307f9549f71468e86e26c1 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: Arjan van de Ven Acked-by: Alexey Dobriyan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/proc/generic.c b/fs/proc/generic.c index bc0a0dd..cb4096c 100644 --- a/fs/proc/generic.c +++ b/fs/proc/generic.c @@ -806,12 +806,9 @@ continue_removing: 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); }