From: Chengguang Xu <cgxu519@mykernel.net>
To: jack@suse.com
Cc: linux-ext4@vger.kernel.org, Chengguang Xu <cgxu519@mykernel.net>
Subject: [PATCH] ext2: code cleanup for descriptor_loc()
Date: Sat, 16 Nov 2019 06:49:00 +0800 [thread overview]
Message-ID: <20191115224900.2613-1-cgxu519@mykernel.net> (raw)
Code cleanup by removing unnecessary variable
in descriptor_loc().
Signed-off-by: Chengguang Xu <cgxu519@mykernel.net>
---
fs/ext2/super.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/fs/ext2/super.c b/fs/ext2/super.c
index 30c630d73f0f..bef607d5db28 100644
--- a/fs/ext2/super.c
+++ b/fs/ext2/super.c
@@ -806,7 +806,6 @@ static unsigned long descriptor_loc(struct super_block *sb,
{
struct ext2_sb_info *sbi = EXT2_SB(sb);
unsigned long bg, first_meta_bg;
- int has_super = 0;
first_meta_bg = le32_to_cpu(sbi->s_es->s_first_meta_bg);
@@ -814,10 +813,8 @@ static unsigned long descriptor_loc(struct super_block *sb,
nr < first_meta_bg)
return (logic_sb_block + nr + 1);
bg = sbi->s_desc_per_block * nr;
- if (ext2_bg_has_super(sb, bg))
- has_super = 1;
- return ext2_group_first_block_no(sb, bg) + has_super;
+ return ext2_group_first_block_no(sb, bg) + ext2_bg_has_super(sb, bg);
}
static int ext2_fill_super(struct super_block *sb, void *data, int silent)
--
2.21.0
next reply other threads:[~2019-11-15 22:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-15 22:49 Chengguang Xu [this message]
2019-11-19 16:05 ` [PATCH] ext2: code cleanup for descriptor_loc() Jan Kara
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=20191115224900.2613-1-cgxu519@mykernel.net \
--to=cgxu519@mykernel.net \
--cc=jack@suse.com \
--cc=linux-ext4@vger.kernel.org \
/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 NNTP newsgroup(s).