Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <zhao.xichao@vivo.com>
Reviewed-by: Zhihao Cheng <chengzhihao1@huawei.com>
Signed-off-by: Richard Weinberger <richard@nod.at>

authored by

Xichao Zhao and committed by
Richard Weinberger
c0d612b3 0288d5fe

+1 -8
+1 -8
fs/ubifs/tnc_misc.c
··· 321 321 c->fanout, znode->child_cnt); 322 322 ubifs_err(c, "max levels %d, znode level %d", 323 323 UBIFS_MAX_LEVELS, znode->level); 324 - err = 1; 325 324 goto out_dump; 326 325 } 327 326 ··· 341 342 zbr->lnum >= c->leb_cnt || zbr->offs < 0 || 342 343 zbr->offs + zbr->len > c->leb_size || zbr->offs & 7) { 343 344 ubifs_err(c, "bad branch %d", i); 344 - err = 2; 345 345 goto out_dump; 346 346 } 347 347 ··· 353 355 default: 354 356 ubifs_err(c, "bad key type at slot %d: %d", 355 357 i, key_type(c, &zbr->key)); 356 - err = 3; 357 358 goto out_dump; 358 359 } 359 360 ··· 365 368 ubifs_err(c, "bad target node (type %d) length (%d)", 366 369 type, zbr->len); 367 370 ubifs_err(c, "have to be %d", c->ranges[type].len); 368 - err = 4; 369 371 goto out_dump; 370 372 } 371 373 } else if (zbr->len < c->ranges[type].min_len || ··· 374 378 ubifs_err(c, "have to be in range of %d-%d", 375 379 c->ranges[type].min_len, 376 380 c->ranges[type].max_len); 377 - err = 5; 378 381 goto out_dump; 379 382 } 380 383 } ··· 391 396 cmp = keys_cmp(c, key1, key2); 392 397 if (cmp > 0) { 393 398 ubifs_err(c, "bad key order (keys %d and %d)", i, i + 1); 394 - err = 6; 395 399 goto out_dump; 396 400 } else if (cmp == 0 && !is_hash_key(c, key1)) { 397 401 /* These can only be keys with colliding hash */ 398 402 ubifs_err(c, "keys %d and %d are not hashed but equivalent", 399 403 i, i + 1); 400 - err = 7; 401 404 goto out_dump; 402 405 } 403 406 } ··· 404 411 return 0; 405 412 406 413 out_dump: 407 - ubifs_err(c, "bad indexing node at LEB %d:%d, error %d", lnum, offs, err); 414 + ubifs_err(c, "bad indexing node at LEB %d:%d", lnum, offs); 408 415 ubifs_dump_node(c, idx, c->max_idx_node_sz); 409 416 kfree(idx); 410 417 return -EINVAL;