LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] drivers/message/i2o/device.c warnings
@ 2008-02-27 23:14 Luis Henriques
  0 siblings, 0 replies; only message in thread
From: Luis Henriques @ 2008-02-27 23:14 UTC (permalink / raw)
  To: linux-kernel; +Cc: Markus.Lidel

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);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-02-27 23:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-27 23:14 [PATCH] drivers/message/i2o/device.c warnings Luis Henriques

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).