Wrapfs: remove unnecessary initializations
authorErez Zadok <ezk@cs.sunysb.edu>
Wed, 27 Nov 2013 04:03:46 +0000 (23:03 -0500)
committerErez Zadok <ezk@cs.sunysb.edu>
Sun, 3 Apr 2016 19:23:29 +0000 (15:23 -0400)
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/wrapfs/file.c
fs/wrapfs/inode.c
fs/wrapfs/lookup.c

index dc6f2a442637bd08e2415f71071a866bc6c1a730..ccf47978babb463ad0707ea9692e18dd095542d2 100644 (file)
@@ -31,7 +31,8 @@ static ssize_t wrapfs_read(struct file *file, char __user *buf,
 static ssize_t wrapfs_write(struct file *file, const char __user *buf,
                            size_t count, loff_t *ppos)
 {
-       int err = 0;
+       int err;
+
        struct file *lower_file;
        struct dentry *dentry = file->f_path.dentry;
 
@@ -50,7 +51,7 @@ static ssize_t wrapfs_write(struct file *file, const char __user *buf,
 
 static int wrapfs_readdir(struct file *file, struct dir_context *ctx)
 {
-       int err = 0;
+       int err;
        struct file *lower_file = NULL;
        struct dentry *dentry = file->f_path.dentry;
 
index 75bb82ab7e91c7ee49f9009e148731aa9cfd9473..b02a1f6b5b8510d74d9522889584fe154448337d 100644 (file)
@@ -14,7 +14,7 @@
 static int wrapfs_create(struct inode *dir, struct dentry *dentry,
                         umode_t mode, bool want_excl)
 {
-       int err = 0;
+       int err;
        struct dentry *lower_dentry;
        struct dentry *lower_parent_dentry = NULL;
        struct path lower_path;
@@ -118,7 +118,7 @@ out:
 static int wrapfs_symlink(struct inode *dir, struct dentry *dentry,
                          const char *symname)
 {
-       int err = 0;
+       int err;
        struct dentry *lower_dentry;
        struct dentry *lower_parent_dentry = NULL;
        struct path lower_path;
@@ -144,7 +144,7 @@ out:
 
 static int wrapfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
 {
-       int err = 0;
+       int err;
        struct dentry *lower_dentry;
        struct dentry *lower_parent_dentry = NULL;
        struct path lower_path;
@@ -203,7 +203,7 @@ out:
 static int wrapfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode,
                        dev_t dev)
 {
-       int err = 0;
+       int err;
        struct dentry *lower_dentry;
        struct dentry *lower_parent_dentry = NULL;
        struct path lower_path;
@@ -361,7 +361,7 @@ static int wrapfs_permission(struct inode *inode, int mask)
 
 static int wrapfs_setattr(struct dentry *dentry, struct iattr *ia)
 {
-       int err = 0;
+       int err;
        struct dentry *lower_dentry;
        struct inode *inode;
        struct inode *lower_inode;
index 2483f4fcd0c2dd1ef9dfa67826a91babb6bb4325..efe5d11953bf732763b6bccd1e4da44999875574 100644 (file)
@@ -271,9 +271,9 @@ out:
 struct dentry *wrapfs_lookup(struct inode *dir, struct dentry *dentry,
                             unsigned int flags)
 {
+       int err;
        struct dentry *ret, *parent;
        struct path lower_parent_path;
-       int err = 0;
 
        parent = dget_parent(dentry);