提交 76df275c 编写于 作者: H Heinrich Schuchardt 提交者: Tom Rini

yaffs2: rework yaffs_new_obj_id

The iterator variable of list_for_each is never NULL.
if (1 || A) is always true.
Use break if entry found.
Signed-off-by: NHeinrich Schuchardt <xypron.glpk@gmx.de>
上级 65d87d6c
......@@ -1870,13 +1870,12 @@ static int yaffs_new_obj_id(struct yaffs_dev *dev)
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) {
/* If there is already one in the list */
if (i && list_entry(i, struct yaffs_obj,
hash_link)->obj_id == n) {
found = 0;
break;
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册