From: Mateusz Nosek Date: Tue, 7 Apr 2020 03:07:54 +0000 (-0700) Subject: mm/shmem.c: clean code by removing unnecessary assignment X-Git-Tag: v5.10.7~2858^2~85 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=343c3d7f0927e000427fae5e361aa560f83dd5b5;p=platform%2Fkernel%2Flinux-rpi.git mm/shmem.c: clean code by removing unnecessary assignment Previously 0 was assigned to variable 'error' but the variable was never read before reassignemnt later. So the assignment can be removed. Signed-off-by: Mateusz Nosek Signed-off-by: Andrew Morton Reviewed-by: Matthew Wilcox (Oracle) Acked-by: Pankaj Gupta Cc: Hugh Dickins Link: http://lkml.kernel.org/r/20200301152832.24595-1-mateusznosek0@gmail.com Signed-off-by: Linus Torvalds --- diff --git a/mm/shmem.c b/mm/shmem.c index 97448a4..e23fea4 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -3120,12 +3120,9 @@ static int shmem_symlink(struct inode *dir, struct dentry *dentry, const char *s error = security_inode_init_security(inode, dir, &dentry->d_name, shmem_initxattrs, NULL); - if (error) { - if (error != -EOPNOTSUPP) { - iput(inode); - return error; - } - error = 0; + if (error && error != -EOPNOTSUPP) { + iput(inode); + return error; } inode->i_size = len-1;