From: Namjae Jeon Date: Sat, 2 Mar 2013 03:40:50 +0000 (+0900) Subject: f2fs: optimize and change return path in lookup_free_nid_list X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=3aa770a9c9d077283b1aa07e8549a4fdc41fc5ed;p=openwrt%2Fstaging%2Fblogic.git f2fs: optimize and change return path in lookup_free_nid_list Optimize and change return path in lookup_free_nid_list Signed-off-by: Namjae Jeon Signed-off-by: Amit Sahrawat Signed-off-by: Jaegeuk Kim --- diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index 58f7216993c7..6006e8e8a5f3 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -1195,14 +1195,13 @@ const struct address_space_operations f2fs_node_aops = { static struct free_nid *__lookup_free_nid_list(nid_t n, struct list_head *head) { struct list_head *this; - struct free_nid *i = NULL; + struct free_nid *i; list_for_each(this, head) { i = list_entry(this, struct free_nid, list); if (i->nid == n) - break; - i = NULL; + return i; } - return i; + return NULL; } static void __del_from_free_nid_list(struct free_nid *i)