Skip to content

Commit b793a8c

Browse files
hujianyangdedekind
authored andcommitted
UBIFS: remove useless statements
This patch removes useless and duplicate statements. Signed-off-by: hujianyang <hujianyang@huawei.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
1 parent ce6ebdb commit b793a8c

7 files changed

Lines changed: 2 additions & 10 deletions

File tree

‎fs/ubifs/lpt.c‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1464,7 +1464,6 @@ struct ubifs_lprops *ubifs_lpt_lookup(struct ubifs_info *c, int lnum)
14641464
return ERR_CAST(nnode);
14651465
}
14661466
iip = ((i >> shft) & (UBIFS_LPT_FANOUT - 1));
1467-
shft -= UBIFS_LPT_FANOUT_SHIFT;
14681467
pnode = ubifs_get_pnode(c, nnode, iip);
14691468
if (IS_ERR(pnode))
14701469
return ERR_CAST(pnode);
@@ -1604,7 +1603,6 @@ struct ubifs_lprops *ubifs_lpt_lookup_dirty(struct ubifs_info *c, int lnum)
16041603
return ERR_CAST(nnode);
16051604
}
16061605
iip = ((i >> shft) & (UBIFS_LPT_FANOUT - 1));
1607-
shft -= UBIFS_LPT_FANOUT_SHIFT;
16081606
pnode = ubifs_get_pnode(c, nnode, iip);
16091607
if (IS_ERR(pnode))
16101608
return ERR_CAST(pnode);
@@ -1964,7 +1962,6 @@ int ubifs_lpt_scan_nolock(struct ubifs_info *c, int start_lnum, int end_lnum,
19641962
}
19651963
}
19661964
iip = ((i >> shft) & (UBIFS_LPT_FANOUT - 1));
1967-
shft -= UBIFS_LPT_FANOUT_SHIFT;
19681965
pnode = scan_get_pnode(c, path + h, nnode, iip);
19691966
if (IS_ERR(pnode)) {
19701967
err = PTR_ERR(pnode);

‎fs/ubifs/lpt_commit.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,6 @@ static int layout_cnodes(struct ubifs_info *c)
304304
ubifs_assert(lnum >= c->lpt_first &&
305305
lnum <= c->lpt_last);
306306
}
307-
done_ltab = 1;
308307
c->ltab_lnum = lnum;
309308
c->ltab_offs = offs;
310309
offs += c->ltab_sz;
@@ -514,7 +513,6 @@ static int write_cnodes(struct ubifs_info *c)
514513
if (err)
515514
return err;
516515
}
517-
done_ltab = 1;
518516
ubifs_pack_ltab(c, buf + offs, c->ltab_cmt);
519517
offs += c->ltab_sz;
520518
dbg_chk_lpt_sz(c, 1, c->ltab_sz);

‎fs/ubifs/orphan.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,6 @@ static int write_orph_nodes(struct ubifs_info *c, int atomic)
346346
int lnum;
347347

348348
/* Unmap any unused LEBs after consolidation */
349-
lnum = c->ohead_lnum + 1;
350349
for (lnum = c->ohead_lnum + 1; lnum <= c->orph_last; lnum++) {
351350
err = ubifs_leb_unmap(c, lnum);
352351
if (err)

‎fs/ubifs/sb.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ static int validate_sb(struct ubifs_info *c, struct ubifs_sb_node *sup)
447447
goto failed;
448448
}
449449

450-
if (c->default_compr < 0 || c->default_compr >= UBIFS_COMPR_TYPES_CNT) {
450+
if (c->default_compr >= UBIFS_COMPR_TYPES_CNT) {
451451
err = 13;
452452
goto failed;
453453
}

‎fs/ubifs/super.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ static int validate_inode(struct ubifs_info *c, const struct inode *inode)
7575
return 1;
7676
}
7777

78-
if (ui->compr_type < 0 || ui->compr_type >= UBIFS_COMPR_TYPES_CNT) {
78+
if (ui->compr_type >= UBIFS_COMPR_TYPES_CNT) {
7979
ubifs_err("unknown compression type %d", ui->compr_type);
8080
return 2;
8181
}

‎fs/ubifs/tnc.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3294,7 +3294,6 @@ int dbg_check_inode_size(struct ubifs_info *c, const struct inode *inode,
32943294
goto out_unlock;
32953295

32963296
if (err) {
3297-
err = -EINVAL;
32983297
key = &from_key;
32993298
goto out_dump;
33003299
}

‎fs/ubifs/tnc_commit.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,6 @@ static int layout_in_gaps(struct ubifs_info *c, int cnt)
389389
ubifs_dump_lprops(c);
390390
}
391391
/* Try to commit anyway */
392-
err = 0;
393392
break;
394393
}
395394
p++;

0 commit comments

Comments
 (0)