From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Gruenbacher Date: Sat, 19 Dec 2020 21:48:29 +0100 Subject: [Cluster-devel] [PATCH v2 01/20] gfs2: Deobfuscate function jdesc_find_i In-Reply-To: <20201219204848.285781-1-agruenba@redhat.com> References: <20201219204848.285781-1-agruenba@redhat.com> Message-ID: <20201219204848.285781-2-agruenba@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Clean up this function to show that it is trivial. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/super.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c index b3d951ab8068..08aef061b29d 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) -- 2.26.2