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>
This commit is contained in:
Arjan van de Ven
2008-07-25 19:45:41 -07:00
committed by Linus Torvalds
parent 5c752ad9f3
commit 99fcd77d15
3 changed files with 3 additions and 8 deletions

View File

@@ -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;
}