Commit 6da5156f authored by Julia Lawall's avatar Julia Lawall Committed by Artem Bityutskiy

UBIFS: use ERR_CAST

Use ERR_CAST(x) rather than ERR_PTR(PTR_ERR(x)).  The former makes more
clear what is the purpose of the operation, which otherwise looks like a
no-op.
Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
parent 276de5d2
...@@ -1457,13 +1457,13 @@ struct ubifs_lprops *ubifs_lpt_lookup(struct ubifs_info *c, int lnum) ...@@ -1457,13 +1457,13 @@ struct ubifs_lprops *ubifs_lpt_lookup(struct ubifs_info *c, int lnum)
shft -= UBIFS_LPT_FANOUT_SHIFT; shft -= UBIFS_LPT_FANOUT_SHIFT;
nnode = ubifs_get_nnode(c, nnode, iip); nnode = ubifs_get_nnode(c, nnode, iip);
if (IS_ERR(nnode)) if (IS_ERR(nnode))
return ERR_PTR(PTR_ERR(nnode)); return ERR_CAST(nnode);
} }
iip = ((i >> shft) & (UBIFS_LPT_FANOUT - 1)); iip = ((i >> shft) & (UBIFS_LPT_FANOUT - 1));
shft -= UBIFS_LPT_FANOUT_SHIFT; shft -= UBIFS_LPT_FANOUT_SHIFT;
pnode = ubifs_get_pnode(c, nnode, iip); pnode = ubifs_get_pnode(c, nnode, iip);
if (IS_ERR(pnode)) if (IS_ERR(pnode))
return ERR_PTR(PTR_ERR(pnode)); return ERR_CAST(pnode);
iip = (i & (UBIFS_LPT_FANOUT - 1)); iip = (i & (UBIFS_LPT_FANOUT - 1));
dbg_lp("LEB %d, free %d, dirty %d, flags %d", lnum, dbg_lp("LEB %d, free %d, dirty %d, flags %d", lnum,
pnode->lprops[iip].free, pnode->lprops[iip].dirty, pnode->lprops[iip].free, pnode->lprops[iip].dirty,
...@@ -1586,7 +1586,7 @@ struct ubifs_lprops *ubifs_lpt_lookup_dirty(struct ubifs_info *c, int lnum) ...@@ -1586,7 +1586,7 @@ struct ubifs_lprops *ubifs_lpt_lookup_dirty(struct ubifs_info *c, int lnum)
nnode = c->nroot; nnode = c->nroot;
nnode = dirty_cow_nnode(c, nnode); nnode = dirty_cow_nnode(c, nnode);
if (IS_ERR(nnode)) if (IS_ERR(nnode))
return ERR_PTR(PTR_ERR(nnode)); return ERR_CAST(nnode);
i = lnum - c->main_first; i = lnum - c->main_first;
shft = c->lpt_hght * UBIFS_LPT_FANOUT_SHIFT; shft = c->lpt_hght * UBIFS_LPT_FANOUT_SHIFT;
for (h = 1; h < c->lpt_hght; h++) { for (h = 1; h < c->lpt_hght; h++) {
...@@ -1594,19 +1594,19 @@ struct ubifs_lprops *ubifs_lpt_lookup_dirty(struct ubifs_info *c, int lnum) ...@@ -1594,19 +1594,19 @@ struct ubifs_lprops *ubifs_lpt_lookup_dirty(struct ubifs_info *c, int lnum)
shft -= UBIFS_LPT_FANOUT_SHIFT; shft -= UBIFS_LPT_FANOUT_SHIFT;
nnode = ubifs_get_nnode(c, nnode, iip); nnode = ubifs_get_nnode(c, nnode, iip);
if (IS_ERR(nnode)) if (IS_ERR(nnode))
return ERR_PTR(PTR_ERR(nnode)); return ERR_CAST(nnode);
nnode = dirty_cow_nnode(c, nnode); nnode = dirty_cow_nnode(c, nnode);
if (IS_ERR(nnode)) if (IS_ERR(nnode))
return ERR_PTR(PTR_ERR(nnode)); return ERR_CAST(nnode);
} }
iip = ((i >> shft) & (UBIFS_LPT_FANOUT - 1)); iip = ((i >> shft) & (UBIFS_LPT_FANOUT - 1));
shft -= UBIFS_LPT_FANOUT_SHIFT; shft -= UBIFS_LPT_FANOUT_SHIFT;
pnode = ubifs_get_pnode(c, nnode, iip); pnode = ubifs_get_pnode(c, nnode, iip);
if (IS_ERR(pnode)) if (IS_ERR(pnode))
return ERR_PTR(PTR_ERR(pnode)); return ERR_CAST(pnode);
pnode = dirty_cow_pnode(c, pnode); pnode = dirty_cow_pnode(c, pnode);
if (IS_ERR(pnode)) if (IS_ERR(pnode))
return ERR_PTR(PTR_ERR(pnode)); return ERR_CAST(pnode);
iip = (i & (UBIFS_LPT_FANOUT - 1)); iip = (i & (UBIFS_LPT_FANOUT - 1));
dbg_lp("LEB %d, free %d, dirty %d, flags %d", lnum, dbg_lp("LEB %d, free %d, dirty %d, flags %d", lnum,
pnode->lprops[iip].free, pnode->lprops[iip].dirty, pnode->lprops[iip].free, pnode->lprops[iip].dirty,
......
...@@ -646,7 +646,7 @@ static struct ubifs_pnode *pnode_lookup(struct ubifs_info *c, int i) ...@@ -646,7 +646,7 @@ static struct ubifs_pnode *pnode_lookup(struct ubifs_info *c, int i)
shft -= UBIFS_LPT_FANOUT_SHIFT; shft -= UBIFS_LPT_FANOUT_SHIFT;
nnode = ubifs_get_nnode(c, nnode, iip); nnode = ubifs_get_nnode(c, nnode, iip);
if (IS_ERR(nnode)) if (IS_ERR(nnode))
return ERR_PTR(PTR_ERR(nnode)); return ERR_CAST(nnode);
} }
iip = ((i >> shft) & (UBIFS_LPT_FANOUT - 1)); iip = ((i >> shft) & (UBIFS_LPT_FANOUT - 1));
return ubifs_get_pnode(c, nnode, iip); return ubifs_get_pnode(c, nnode, iip);
......
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