[Open-FCoE] [PATCH] libfc: fix warn_unused_result for sysfs files

Robert Love robert.w.love at intel.com
Mon Sep 8 16:25:27 UTC 2008


drivers/scsi/fcoe/fcoeinit.c: In function ‘fcoeinit’:
drivers/scsi/fcoe/fcoeinit.c:311: warning: ignoring return value of ‘sysfs_create_file’, declared with attribute warn_unused_result
drivers/scsi/fcoe/fcoeinit.c:312: warning: ignoring return value of ‘sysfs_create_file’, declared with attribute warn_unused_result

Signed-off-by: Robert Love <robert.w.love at intel.com>
---

 drivers/scsi/fcoe/fcoeinit.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/fcoe/fcoeinit.c b/drivers/scsi/fcoe/fcoeinit.c
index ac98159..4123adf 100644
--- a/drivers/scsi/fcoe/fcoeinit.c
+++ b/drivers/scsi/fcoe/fcoeinit.c
@@ -308,8 +308,14 @@ static int __init fcoeinit(void)
 	struct fcoe_percpu_s *p;
 	struct fcoe_info *fci = &fcoei;
 
-	sysfs_create_file(&THIS_MODULE->mkobj.kobj, &fcoe_destroyattr.attr);
-	sysfs_create_file(&THIS_MODULE->mkobj.kobj, &fcoe_createattr.attr);
+	rc = sysfs_create_file(&THIS_MODULE->mkobj.kobj,
+			       &fcoe_destroyattr.attr);
+	if (!rc)
+		rc = sysfs_create_file(&THIS_MODULE->mkobj.kobj,
+				       &fcoe_createattr.attr);
+
+	if (rc)
+		return rc;
 
 	rwlock_init(&fci->fcoe_hostlist_lock);
 




More information about the devel mailing list