linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christophe Vu-Brugier <cvubrugier@fastmail.fm>
To: linux-fsdevel@vger.kernel.org
Cc: Namjae Jeon <linkinjeon@kernel.org>,
	Sungjong Seo <sj1557.seo@samsung.com>,
	Christophe Vu-Brugier <christophe.vu-brugier@seagate.com>
Subject: [PATCH 1/4] exfat: simplify is_valid_cluster()
Date: Tue,  2 Nov 2021 22:23:55 +0100	[thread overview]
Message-ID: <20211102212358.3849-2-cvubrugier@fastmail.fm> (raw)
In-Reply-To: <20211102212358.3849-1-cvubrugier@fastmail.fm>

From: Christophe Vu-Brugier <christophe.vu-brugier@seagate.com>

Signed-off-by: Christophe Vu-Brugier <christophe.vu-brugier@seagate.com>
---
 fs/exfat/fatent.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/fs/exfat/fatent.c b/fs/exfat/fatent.c
index e949e563443c..81f5fc4a9e60 100644
--- a/fs/exfat/fatent.c
+++ b/fs/exfat/fatent.c
@@ -84,9 +84,7 @@ int exfat_ent_set(struct super_block *sb, unsigned int loc,
 static inline bool is_valid_cluster(struct exfat_sb_info *sbi,
 		unsigned int clus)
 {
-	if (clus < EXFAT_FIRST_CLUSTER || sbi->num_clusters <= clus)
-		return false;
-	return true;
+	return EXFAT_FIRST_CLUSTER <= clus && clus < sbi->num_clusters;
 }
 
 int exfat_ent_get(struct super_block *sb, unsigned int loc,
-- 
2.20.1


  reply	other threads:[~2021-11-02 21:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-02 21:23 [PATCH 0/4] exfat: minor cleanup changes Christophe Vu-Brugier
2021-11-02 21:23 ` Christophe Vu-Brugier [this message]
2021-11-02 21:23 ` [PATCH 2/4] exfat: fix typos in comments Christophe Vu-Brugier
2021-11-02 21:23 ` [PATCH 3/4] exfat: make exfat_find_location() static Christophe Vu-Brugier
2021-11-02 21:23 ` [PATCH 4/4] exfat: reuse exfat_inode_info variable instead of calling EXFAT_I() Christophe Vu-Brugier
2021-11-03  2:41 ` [PATCH 0/4] exfat: minor cleanup changes Namjae Jeon

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=20211102212358.3849-2-cvubrugier@fastmail.fm \
    --to=cvubrugier@fastmail.fm \
    --cc=christophe.vu-brugier@seagate.com \
    --cc=linkinjeon@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=sj1557.seo@samsung.com \
    /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).