From: Charles Manning Date: Thu, 28 May 2015 21:09:48 +0000 (+1200) Subject: yaffs: Clean up defeated conditional. X-Git-Tag: aleph1-release~27 X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=commitdiff_plain;h=e8bdf6a905e8e37b82fb310306f96ab4de930923 yaffs: Clean up defeated conditional. Signed-off-by: Charles Manning --- diff --git a/yaffs_guts.c b/yaffs_guts.c index 1c0ae71..dd35e25 100644 --- a/yaffs_guts.c +++ b/yaffs_guts.c @@ -1922,21 +1922,18 @@ static int yaffs_new_obj_id(struct yaffs_dev *dev) struct list_head *i; u32 n = (u32) bucket; - /* Now find an object value that has not already been taken - * by scanning the list. + /* + * Now find an object value that has not already been taken + * by scanning the list, incrementing each time by number of buckets. */ - while (!found) { found = 1; n += YAFFS_NOBJECT_BUCKETS; - if (1 || dev->obj_bucket[bucket].count > 0) { - list_for_each(i, &dev->obj_bucket[bucket].list) { - /* If there is already one in the list */ - if (i && list_entry(i, struct yaffs_obj, - hash_link)->obj_id == n) { - found = 0; - } - } + list_for_each(i, &dev->obj_bucket[bucket].list) { + /* Check if this value is already taken. */ + if (i && list_entry(i, struct yaffs_obj, + hash_link)->obj_id == n) + found = 0; } } return n;