Skip to content

Commit c0d612b

Browse files
Xichao Zhaorichardweinberger
authored andcommitted
ubifs: Remove unnecessary variable assignments
When an error occurs, ubifs_err is used to directly print the error, and different errors have different formats for printing. Therefore, it's not necessary to use 'err' to locate the error occurrence. Thus, remove the relevant assignments to 'err'. Signed-off-by: Xichao Zhao <[email protected]> Reviewed-by: Zhihao Cheng <[email protected]> Signed-off-by: Richard Weinberger <[email protected]>
1 parent 0288d5f commit c0d612b

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

fs/ubifs/tnc_misc.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,6 @@ static int read_znode(struct ubifs_info *c, struct ubifs_zbranch *zzbr,
321321
c->fanout, znode->child_cnt);
322322
ubifs_err(c, "max levels %d, znode level %d",
323323
UBIFS_MAX_LEVELS, znode->level);
324-
err = 1;
325324
goto out_dump;
326325
}
327326

@@ -342,7 +341,6 @@ static int read_znode(struct ubifs_info *c, struct ubifs_zbranch *zzbr,
342341
zbr->lnum >= c->leb_cnt || zbr->offs < 0 ||
343342
zbr->offs + zbr->len > c->leb_size || zbr->offs & 7) {
344343
ubifs_err(c, "bad branch %d", i);
345-
err = 2;
346344
goto out_dump;
347345
}
348346

@@ -355,7 +353,6 @@ static int read_znode(struct ubifs_info *c, struct ubifs_zbranch *zzbr,
355353
default:
356354
ubifs_err(c, "bad key type at slot %d: %d",
357355
i, key_type(c, &zbr->key));
358-
err = 3;
359356
goto out_dump;
360357
}
361358

@@ -368,7 +365,6 @@ static int read_znode(struct ubifs_info *c, struct ubifs_zbranch *zzbr,
368365
ubifs_err(c, "bad target node (type %d) length (%d)",
369366
type, zbr->len);
370367
ubifs_err(c, "have to be %d", c->ranges[type].len);
371-
err = 4;
372368
goto out_dump;
373369
}
374370
} else if (zbr->len < c->ranges[type].min_len ||
@@ -378,7 +374,6 @@ static int read_znode(struct ubifs_info *c, struct ubifs_zbranch *zzbr,
378374
ubifs_err(c, "have to be in range of %d-%d",
379375
c->ranges[type].min_len,
380376
c->ranges[type].max_len);
381-
err = 5;
382377
goto out_dump;
383378
}
384379
}
@@ -396,13 +391,11 @@ static int read_znode(struct ubifs_info *c, struct ubifs_zbranch *zzbr,
396391
cmp = keys_cmp(c, key1, key2);
397392
if (cmp > 0) {
398393
ubifs_err(c, "bad key order (keys %d and %d)", i, i + 1);
399-
err = 6;
400394
goto out_dump;
401395
} else if (cmp == 0 && !is_hash_key(c, key1)) {
402396
/* These can only be keys with colliding hash */
403397
ubifs_err(c, "keys %d and %d are not hashed but equivalent",
404398
i, i + 1);
405-
err = 7;
406399
goto out_dump;
407400
}
408401
}
@@ -411,7 +404,7 @@ static int read_znode(struct ubifs_info *c, struct ubifs_zbranch *zzbr,
411404
return 0;
412405

413406
out_dump:
414-
ubifs_err(c, "bad indexing node at LEB %d:%d, error %d", lnum, offs, err);
407+
ubifs_err(c, "bad indexing node at LEB %d:%d", lnum, offs);
415408
ubifs_dump_node(c, idx, c->max_idx_node_sz);
416409
kfree(idx);
417410
return -EINVAL;

0 commit comments

Comments
 (0)