gfs2: Un-obfuscate function jdesc_find_i
authorAndreas Gruenbacher <agruenba@redhat.com>
Sun, 6 Dec 2020 23:06:32 +0000 (00:06 +0100)
committerAndreas Gruenbacher <agruenba@redhat.com>
Tue, 19 Jan 2021 20:16:43 +0000 (21:16 +0100)
Clean up this function to show that it is trivial.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
fs/gfs2/super.c

index 2f56acc41c0498184ea367085267e95b7c234611..ed7a829e9ffe3c6a888620acc1934dced552e661 100644 (file)
@@ -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)