[PATCH] ext4: extents: Remove unnecessary ‘0’ values from err

From: Li kunyu
Date: Mon Apr 01 2024 - 23:14:04 EST


err is assigned first, so it does not need to initialize the assignment.

Signed-off-by: Li kunyu <kunyu@xxxxxxxxxxxx>
---
fs/ext4/extents.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index caace8c3fd3c1..f3cb570951a7e 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -1403,7 +1403,7 @@ static int ext4_ext_create_new_leaf(handle_t *handle, struct inode *inode,
{
struct ext4_ext_path *path = *ppath;
struct ext4_ext_path *curp;
- int depth, i, err = 0;
+ int depth, i, err;

repeat:
i = depth = ext_depth(inode);
@@ -1709,7 +1709,7 @@ static int ext4_ext_correct_indexes(handle_t *handle, struct inode *inode,
int depth = ext_depth(inode);
struct ext4_extent *ex;
__le32 border;
- int k, err = 0;
+ int k, err;

eh = path[depth].p_hdr;
ex = path[depth].p_ext;
@@ -2569,7 +2569,7 @@ ext4_ext_rm_leaf(handle_t *handle, struct inode *inode,
ext4_lblk_t start, ext4_lblk_t end)
{
struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb);
- int err = 0, correct_index = 0;
+ int err, correct_index = 0;
int depth = ext_depth(inode), credits, revoke_credits;
struct ext4_extent_header *eh;
ext4_lblk_t a, b;
@@ -2794,7 +2794,7 @@ int ext4_ext_remove_space(struct inode *inode, ext4_lblk_t start,
struct ext4_ext_path *path = NULL;
struct partial_cluster partial;
handle_t *handle;
- int i = 0, err = 0;
+ int i = 0, err;

partial.pclu = 0;
partial.lblk = 0;
@@ -3162,7 +3162,7 @@ static int ext4_split_extent_at(handle_t *handle,
struct ext4_extent *ex, newex, orig_ex, zero_ex;
struct ext4_extent *ex2 = NULL;
unsigned int ee_len, depth;
- int err = 0;
+ int err;

BUG_ON((split_flag & (EXT4_EXT_DATA_VALID1 | EXT4_EXT_DATA_VALID2)) ==
(EXT4_EXT_DATA_VALID1 | EXT4_EXT_DATA_VALID2));
@@ -3403,7 +3403,7 @@ static int ext4_ext_convert_to_initialized(handle_t *handle,
ext4_lblk_t ee_block, eof_block;
unsigned int ee_len, depth, map_len = map->m_len;
int allocated = 0, max_zeroout = 0;
- int err = 0;
+ int err;
int split_flag = EXT4_EXT_DATA_VALID2;

ext_debug(inode, "logical block %llu, max_blocks %u\n",
@@ -3698,7 +3698,7 @@ static int ext4_convert_unwritten_extents_endio(handle_t *handle,
ext4_lblk_t ee_block;
unsigned int ee_len;
int depth;
- int err = 0;
+ int err;

depth = ext_depth(inode);
ex = path[depth].p_ext;
@@ -3761,7 +3761,7 @@ convert_initialized_extent(handle_t *handle, struct inode *inode,
ext4_lblk_t ee_block;
unsigned int ee_len;
int depth;
- int err = 0;
+ int err;

/*
* Make sure that the extent is no bigger than we support with
@@ -4418,7 +4418,7 @@ int ext4_ext_truncate(handle_t *handle, struct inode *inode)
{
struct super_block *sb = inode->i_sb;
ext4_lblk_t last_block;
- int err = 0;
+ int err;

/*
* TODO: optimization is possible here.
--
2.18.2