From be222ac029c31b38ffdfdc135ced8b5a40b8216b Mon Sep 17 00:00:00 2001 From: Sughosh Ganu Date: Wed, 28 Aug 2024 22:24:22 +0530 Subject: 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 Reviewed-by: Simon Glass --- fs/yaffs2/yaffs_guts.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'fs/yaffs2/yaffs_guts.c') 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; } -- cgit v1.2.3