Commit 99fcd77d authored by Arjan van de Ven's avatar Arjan van de Ven Committed by Linus Torvalds

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: default avatarArjan van de Ven <arjan@linux.intel.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 5c752ad9
...@@ -459,11 +459,8 @@ int sysfs_add_one(struct sysfs_addrm_cxt *acxt, struct sysfs_dirent *sd) ...@@ -459,11 +459,8 @@ int sysfs_add_one(struct sysfs_addrm_cxt *acxt, struct sysfs_dirent *sd)
int ret; int ret;
ret = __sysfs_add_one(acxt, sd); ret = __sysfs_add_one(acxt, sd);
if (ret == -EEXIST) { WARN(ret == -EEXIST, KERN_WARNING "sysfs: duplicate filename '%s' "
printk(KERN_WARNING "sysfs: duplicate filename '%s' "
"can not be created\n", sd->s_name); "can not be created\n", sd->s_name);
WARN_ON(1);
}
return ret; return ret;
} }
......
...@@ -337,9 +337,8 @@ static int sysfs_open_file(struct inode *inode, struct file *file) ...@@ -337,9 +337,8 @@ static int sysfs_open_file(struct inode *inode, struct file *file)
if (kobj->ktype && kobj->ktype->sysfs_ops) if (kobj->ktype && kobj->ktype->sysfs_ops)
ops = kobj->ktype->sysfs_ops; ops = kobj->ktype->sysfs_ops;
else { else {
printk(KERN_ERR "missing sysfs attribute operations for " WARN(1, KERN_ERR "missing sysfs attribute operations for "
"kobject: %s\n", kobject_name(kobj)); "kobject: %s\n", kobject_name(kobj));
WARN_ON(1);
goto err_out; goto err_out;
} }
......
...@@ -134,9 +134,8 @@ void sysfs_remove_group(struct kobject * kobj, ...@@ -134,9 +134,8 @@ void sysfs_remove_group(struct kobject * kobj,
if (grp->name) { if (grp->name) {
sd = sysfs_get_dirent(dir_sd, grp->name); sd = sysfs_get_dirent(dir_sd, grp->name);
if (!sd) { if (!sd) {
printk(KERN_WARNING "sysfs group %p not found for " WARN(!sd, KERN_WARNING "sysfs group %p not found for "
"kobject '%s'\n", grp, kobject_name(kobj)); "kobject '%s'\n", grp, kobject_name(kobj));
WARN_ON(!sd);
return; return;
} }
} else } else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment