Skip to content

Commit

Permalink
ext4: remove redundant assignment to error
Browse files Browse the repository at this point in the history
Variable error is set to zero but this value is never read as it's not
used later on, hence it is a redundant assignment and can be removed.

Cleans up the following clang-analyzer warning:

fs/ext4/ioctl.c:657:3: warning: Value stored to 'error' is never read
[clang-analyzer-deadcode.DeadStores].

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Link: https://lore.kernel.org/r/1619691409-83160-1-git-send-email-jiapeng.chong@linux.alibaba.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
  • Loading branch information
Jiapeng Chong authored and Theodore Ts'o committed Jun 17, 2021
1 parent 5c68015 commit 1fc57ca
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions fs/ext4/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -659,10 +659,9 @@ static int ext4_ioc_getfsmap(struct super_block *sb,
info.gi_sb = sb;
info.gi_data = arg;
error = ext4_getfsmap(sb, &xhead, ext4_getfsmap_format, &info);
if (error == EXT4_QUERY_RANGE_ABORT) {
error = 0;
if (error == EXT4_QUERY_RANGE_ABORT)
aborted = true;
} else if (error)
else if (error)
return error;

/* If we didn't abort, set the "last" flag in the last fmx */
Expand Down

0 comments on commit 1fc57ca

Please sign in to comment.