aboutsummaryrefslogtreecommitdiffstats
path: root/fs/sysfs/dir.c
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@linux.intel.com>2008-07-25 19:45:41 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-26 12:00:07 -0700
commit99fcd77d15357e8ba51005c25cc750b9c28b2688 (patch)
tree403293819dc7bcd854c50d8c486a1fdbbf9711a2 /fs/sysfs/dir.c
parent5c752ad9f35910ff1912b3f3ae82878178ddc432 (diff)
downloadkernel_samsung_smdk4412-99fcd77d15357e8ba51005c25cc750b9c28b2688.tar.gz
kernel_samsung_smdk4412-99fcd77d15357e8ba51005c25cc750b9c28b2688.tar.bz2
kernel_samsung_smdk4412-99fcd77d15357e8ba51005c25cc750b9c28b2688.zip
Use WARN() in fs/sysfs
Use WARN() instead of a printk+WARN_ON() pair; this way the message becomes part of the warning section for better reporting/collection. Also, with this, one fo the if() sections collapses entirely into the WARN(). Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/sysfs/dir.c')
-rw-r--r--fs/sysfs/dir.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
index c1a7efb310b..aedaeba82ae 100644
--- a/fs/sysfs/dir.c
+++ b/fs/sysfs/dir.c
@@ -459,11 +459,8 @@ int sysfs_add_one(struct sysfs_addrm_cxt *acxt, struct sysfs_dirent *sd)
int ret;
ret = __sysfs_add_one(acxt, sd);
- if (ret == -EEXIST) {
- printk(KERN_WARNING "sysfs: duplicate filename '%s' "
+ WARN(ret == -EEXIST, KERN_WARNING "sysfs: duplicate filename '%s' "
"can not be created\n", sd->s_name);
- WARN_ON(1);
- }
return ret;
}