[PATCH] drivers/message/i2o/device.c warnings
From: Luis Henriques
Date: Wed Feb 27 2008 - 18:21:49 EST
Hi,
file drivers/message/i2o/device.c contains the following warnings:
drivers/message/i2o/device.c: In function ‘i2o_device_add’:
drivers/message/i2o/device.c:247: warning: ignoring return value of ‘sysfs_create_link’, declared with attribute warn_unused_result
drivers/message/i2o/device.c:254: warning: ignoring return value of ‘sysfs_create_link’, declared with attribute warn_unused_result
drivers/message/i2o/device.c:260: warning: ignoring return value of ‘sysfs_create_link’, declared with attribute warn_unused_result
drivers/message/i2o/device.c:267: warning: ignoring return value of ‘sysfs_create_link’, declared with attribute warn_unused_result
The following patch is an attempt to remove these warnings.
Signed-off-by: Luis Henriques <lhenriques <at> netvisao.pt>
diff --git a/drivers/message/i2o/device.c b/drivers/message/i2o/device.c
index 489d7c5..73ade62 100644
--- a/drivers/message/i2o/device.c
+++ b/drivers/message/i2o/device.c
@@ -243,29 +243,41 @@ static int i2o_device_add(struct i2o_controller *c, i2o_lct_entry *entry)
/* create user entries for this device */
tmp = i2o_iop_find_device(i2o_dev->iop, i2o_dev->lct_data.user_tid);
- if (tmp && (tmp != i2o_dev))
- sysfs_create_link(&i2o_dev->device.kobj, &tmp->device.kobj,
- "user");
+ if (tmp && (tmp != i2o_dev)) {
+ rc = sysfs_create_link(&i2o_dev->device.kobj, &tmp->device.kobj,
+ "user");
+ if (rc)
+ goto err;
+ }
/* create user entries refering to this device */
list_for_each_entry(tmp, &c->devices, list)
if ((tmp->lct_data.user_tid == i2o_dev->lct_data.tid)
- && (tmp != i2o_dev))
- sysfs_create_link(&tmp->device.kobj,
- &i2o_dev->device.kobj, "user");
+ && (tmp != i2o_dev)) {
+ rc = sysfs_create_link(&tmp->device.kobj,
+ &i2o_dev->device.kobj, "user");
+ if (rc)
+ goto err;
+ }
/* create parent entries for this device */
tmp = i2o_iop_find_device(i2o_dev->iop, i2o_dev->lct_data.parent_tid);
- if (tmp && (tmp != i2o_dev))
- sysfs_create_link(&i2o_dev->device.kobj, &tmp->device.kobj,
- "parent");
+ if (tmp && (tmp != i2o_dev)) {
+ rc = sysfs_create_link(&i2o_dev->device.kobj, &tmp->device.kobj,
+ "parent");
+ if (rc)
+ goto err;
+ }
/* create parent entries refering to this device */
list_for_each_entry(tmp, &c->devices, list)
if ((tmp->lct_data.parent_tid == i2o_dev->lct_data.tid)
- && (tmp != i2o_dev))
- sysfs_create_link(&tmp->device.kobj,
- &i2o_dev->device.kobj, "parent");
+ && (tmp != i2o_dev)) {
+ rc = sysfs_create_link(&tmp->device.kobj,
+ &i2o_dev->device.kobj, "parent");
+ if (rc)
+ goto err;
+ }
i2o_driver_notify_device_add_all(i2o_dev);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/