Linux-ext4 Archive mirror
 help / color / mirror / Atom feed
From: Li kunyu <kunyu@nfschina.com>
To: tytso@mit.edu, adilger.kernel@dilger.ca
Cc: linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org,
	Li kunyu <kunyu@nfschina.com>
Subject: [PATCH] ext4: extents: Remove unnecessary ‘0’ values from err
Date: Tue,  2 Apr 2024 11:13:42 +0800	[thread overview]
Message-ID: <20240402031342.32884-1-kunyu@nfschina.com> (raw)

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

Signed-off-by: Li kunyu <kunyu@nfschina.com>
---
 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


                 reply	other threads:[~2024-04-02  3:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240402031342.32884-1-kunyu@nfschina.com \
    --to=kunyu@nfschina.com \
    --cc=adilger.kernel@dilger.ca \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).