aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorSughosh Ganu <sughosh.ganu@linaro.org>2024-08-28 22:24:22 +0530
committerTom Rini <trini@konsulko.com>2024-08-30 13:51:38 -0600
commitbe222ac029c31b38ffdfdc135ced8b5a40b8216b (patch)
tree3546c8860d46694952674e88766c6e0eccbe71ad /fs
parente83ced1a24095de66e526bd6c10f0f24584baaee (diff)
downloadu-boot-be222ac029c31b38ffdfdc135ced8b5a40b8216b.tar.gz
list: use list_count_nodes() to count list entries
Use the API function list_count_nodes() to count the number of list entries. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/yaffs2/yaffs_guts.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/yaffs2/yaffs_guts.c b/fs/yaffs2/yaffs_guts.c
index e89d02513c1..c20f2f8298f 100644
--- a/fs/yaffs2/yaffs_guts.c
+++ b/fs/yaffs2/yaffs_guts.c
@@ -4452,13 +4452,12 @@ loff_t yaffs_get_obj_length(struct yaffs_obj *obj)
int yaffs_get_obj_link_count(struct yaffs_obj *obj)
{
int count = 0;
- struct list_head *i;
if (!obj->unlinked)
count++; /* the object itself */
- list_for_each(i, &obj->hard_links)
- count++; /* add the hard links; */
+ /* add the hard links; */
+ count += list_count_nodes(&obj->hard_links);
return count;
}