summary refs log tree commit diff
path: root/fs/gfs2/super.c
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruenba@redhat.com>2020-12-07 00:06:32 +0100
committerAndreas Gruenbacher <agruenba@redhat.com>2021-01-19 21:16:43 +0100
commit736b2f778f0a71ce54abe7e6d2c6f7591b95f7b8 (patch)
treedcc3447bd2ad7c11a48ecf26d2c4d1e6cdb4b0e0 /fs/gfs2/super.c
parent19c329f6808995b142b3966301f217c831e7cf31 (diff)
downloadlinux-736b2f778f0a71ce54abe7e6d2c6f7591b95f7b8.tar.gz
gfs2: Un-obfuscate function jdesc_find_i
Clean up this function to show that it is trivial.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Diffstat (limited to 'fs/gfs2/super.c')
-rw-r--r--fs/gfs2/super.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c
index 2f56acc41c04..ed7a829e9ffe 100644
--- a/fs/gfs2/super.c
+++ b/fs/gfs2/super.c
@@ -81,19 +81,12 @@ void gfs2_jindex_free(struct gfs2_sbd *sdp)
 static struct gfs2_jdesc *jdesc_find_i(struct list_head *head, unsigned int jid)
 {
 	struct gfs2_jdesc *jd;
-	int found = 0;
 
 	list_for_each_entry(jd, head, jd_list) {
-		if (jd->jd_jid == jid) {
-			found = 1;
-			break;
-		}
+		if (jd->jd_jid == jid)
+			return jd;
 	}
-
-	if (!found)
-		jd = NULL;
-
-	return jd;
+	return NULL;
 }
 
 struct gfs2_jdesc *gfs2_jdesc_find(struct gfs2_sbd *sdp, unsigned int jid)