aboutsummaryrefslogtreecommitdiff
path: root/fs/pstore
diff options
context:
space:
mode:
authorTony Luck2011-01-06 16:58:58 -0800
committerTony Luck2011-01-06 16:58:58 -0800
commit168f2e14319aba3125946649604e858cbae85be6 (patch)
tree16a811b09a607ccb4e8de13da744b7167346ab8e /fs/pstore
parent0bb77c465f02e8281e24b9f02e7dc8a7e2b81ee2 (diff)
pstore: fix build warning for unused return value from sysfs_create_file
fs/pstore/inode.c: In function 'init_pstore_fs': fs/pstore/inode.c:266: warning: ignoring return value of 'sysfs_create_file', declared with attribute warn_unused_result Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'fs/pstore')
-rw-r--r--fs/pstore/inode.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/fs/pstore/inode.c b/fs/pstore/inode.c
index 0e806aafe857..549d245d0b42 100644
--- a/fs/pstore/inode.c
+++ b/fs/pstore/inode.c
@@ -256,23 +256,28 @@ static struct file_system_type pstore_fs_type = {
static int __init init_pstore_fs(void)
{
- int ret = 0;
+ int rc = 0;
struct kobject *pstorefs_kobj;
pstorefs_kobj = kobject_create_and_add("pstore", fs_kobj);
- if (!pstorefs_kobj)
- return -ENOMEM;
+ if (!pstorefs_kobj) {
+ rc = -ENOMEM;
+ goto done;
+ }
- sysfs_create_file(pstorefs_kobj, &pstore_kmsg_bytes_attr.attr);
+ rc = sysfs_create_file(pstorefs_kobj, &pstore_kmsg_bytes_attr.attr);
+ if (rc)
+ goto done1;
- ret = register_filesystem(&pstore_fs_type);
+ rc = register_filesystem(&pstore_fs_type);
+ if (rc == 0)
+ goto done;
- if (ret) {
- sysfs_remove_file(pstorefs_kobj, &pstore_kmsg_bytes_attr.attr);
- kobject_put(pstorefs_kobj);
- }
-
- return ret;
+ sysfs_remove_file(pstorefs_kobj, &pstore_kmsg_bytes_attr.attr);
+done1:
+ kobject_put(pstorefs_kobj);
+done:
+ return rc;
}
module_init(init_pstore_fs)