Commit 8d47aef4 authored by Hirofumi Nakagawa's avatar Hirofumi Nakagawa Committed by Artem Bityutskiy

UBIFS: remove unneeded unlikely()

IS_ERR() macro already has unlikely(), so do not use constructions
like 'if (unlikely(IS_ERR())'.
Signed-off-by: default avatarHirofumi Nakagawa <hnakagawa@miraclelinux.com>
Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
parent 948cfb21
...@@ -901,11 +901,11 @@ static int get_idx_gc_leb(struct ubifs_info *c) ...@@ -901,11 +901,11 @@ static int get_idx_gc_leb(struct ubifs_info *c)
* it is needed now for this commit. * it is needed now for this commit.
*/ */
lp = ubifs_lpt_lookup_dirty(c, lnum); lp = ubifs_lpt_lookup_dirty(c, lnum);
if (unlikely(IS_ERR(lp))) if (IS_ERR(lp))
return PTR_ERR(lp); return PTR_ERR(lp);
lp = ubifs_change_lp(c, lp, LPROPS_NC, LPROPS_NC, lp = ubifs_change_lp(c, lp, LPROPS_NC, LPROPS_NC,
lp->flags | LPROPS_INDEX, -1); lp->flags | LPROPS_INDEX, -1);
if (unlikely(IS_ERR(lp))) if (IS_ERR(lp))
return PTR_ERR(lp); return PTR_ERR(lp);
dbg_find("LEB %d, dirty %d and free %d flags %#x", dbg_find("LEB %d, dirty %d and free %d flags %#x",
lp->lnum, lp->dirty, lp->free, lp->flags); lp->lnum, lp->dirty, lp->free, lp->flags);
......
...@@ -653,7 +653,7 @@ int ubifs_gc_start_commit(struct ubifs_info *c) ...@@ -653,7 +653,7 @@ int ubifs_gc_start_commit(struct ubifs_info *c)
*/ */
while (1) { while (1) {
lp = ubifs_fast_find_freeable(c); lp = ubifs_fast_find_freeable(c);
if (unlikely(IS_ERR(lp))) { if (IS_ERR(lp)) {
err = PTR_ERR(lp); err = PTR_ERR(lp);
goto out; goto out;
} }
...@@ -665,7 +665,7 @@ int ubifs_gc_start_commit(struct ubifs_info *c) ...@@ -665,7 +665,7 @@ int ubifs_gc_start_commit(struct ubifs_info *c)
if (err) if (err)
goto out; goto out;
lp = ubifs_change_lp(c, lp, c->leb_size, 0, lp->flags, 0); lp = ubifs_change_lp(c, lp, c->leb_size, 0, lp->flags, 0);
if (unlikely(IS_ERR(lp))) { if (IS_ERR(lp)) {
err = PTR_ERR(lp); err = PTR_ERR(lp);
goto out; goto out;
} }
...@@ -680,7 +680,7 @@ int ubifs_gc_start_commit(struct ubifs_info *c) ...@@ -680,7 +680,7 @@ int ubifs_gc_start_commit(struct ubifs_info *c)
/* Record index freeable LEBs for unmapping after commit */ /* Record index freeable LEBs for unmapping after commit */
while (1) { while (1) {
lp = ubifs_fast_find_frdi_idx(c); lp = ubifs_fast_find_frdi_idx(c);
if (unlikely(IS_ERR(lp))) { if (IS_ERR(lp)) {
err = PTR_ERR(lp); err = PTR_ERR(lp);
goto out; goto out;
} }
...@@ -696,7 +696,7 @@ int ubifs_gc_start_commit(struct ubifs_info *c) ...@@ -696,7 +696,7 @@ int ubifs_gc_start_commit(struct ubifs_info *c)
/* Don't release the LEB until after the next commit */ /* Don't release the LEB until after the next commit */
flags = (lp->flags | LPROPS_TAKEN) ^ LPROPS_INDEX; flags = (lp->flags | LPROPS_TAKEN) ^ LPROPS_INDEX;
lp = ubifs_change_lp(c, lp, c->leb_size, 0, flags, 1); lp = ubifs_change_lp(c, lp, c->leb_size, 0, flags, 1);
if (unlikely(IS_ERR(lp))) { if (IS_ERR(lp)) {
err = PTR_ERR(lp); err = PTR_ERR(lp);
kfree(idx_gc); kfree(idx_gc);
goto out; goto out;
......
...@@ -284,7 +284,7 @@ static struct ubifs_znode *dirty_cow_znode(struct ubifs_info *c, ...@@ -284,7 +284,7 @@ static struct ubifs_znode *dirty_cow_znode(struct ubifs_info *c,
} }
zn = copy_znode(c, znode); zn = copy_znode(c, znode);
if (unlikely(IS_ERR(zn))) if (IS_ERR(zn))
return zn; return zn;
if (zbr->len) { if (zbr->len) {
...@@ -1128,7 +1128,7 @@ static struct ubifs_znode *dirty_cow_bottom_up(struct ubifs_info *c, ...@@ -1128,7 +1128,7 @@ static struct ubifs_znode *dirty_cow_bottom_up(struct ubifs_info *c,
ubifs_assert(znode == c->zroot.znode); ubifs_assert(znode == c->zroot.znode);
znode = dirty_cow_znode(c, &c->zroot); znode = dirty_cow_znode(c, &c->zroot);
} }
if (unlikely(IS_ERR(znode)) || !p) if (IS_ERR(znode) || !p)
break; break;
ubifs_assert(path[p - 1] >= 0); ubifs_assert(path[p - 1] >= 0);
ubifs_assert(path[p - 1] < znode->child_cnt); ubifs_assert(path[p - 1] < znode->child_cnt);
......
...@@ -446,7 +446,7 @@ ssize_t ubifs_listxattr(struct dentry *dentry, char *buffer, size_t size) ...@@ -446,7 +446,7 @@ ssize_t ubifs_listxattr(struct dentry *dentry, char *buffer, size_t size)
int type; int type;
xent = ubifs_tnc_next_ent(c, &key, &nm); xent = ubifs_tnc_next_ent(c, &key, &nm);
if (unlikely(IS_ERR(xent))) { if (IS_ERR(xent)) {
err = PTR_ERR(xent); err = PTR_ERR(xent);
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment