UBI: remove dead code
Thanks to new gcc 4.6 for issuing the following warning: drivers/mtd/ubi/vtbl.c: In function ‘create_vtbl’: drivers/mtd/ubi/vtbl.c:311:33: warning: variable ‘old_seb’ set but not used [-Wunused-but-set-variable] This patch removes some dead code and fixes the warning. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
This commit is contained in:
parent
2a826061df
commit
4788b60a5f
|
@ -307,8 +307,7 @@ static int create_vtbl(struct ubi_device *ubi, struct ubi_scan_info *si,
|
||||||
{
|
{
|
||||||
int err, tries = 0;
|
int err, tries = 0;
|
||||||
static struct ubi_vid_hdr *vid_hdr;
|
static struct ubi_vid_hdr *vid_hdr;
|
||||||
struct ubi_scan_volume *sv;
|
struct ubi_scan_leb *new_seb;
|
||||||
struct ubi_scan_leb *new_seb, *old_seb = NULL;
|
|
||||||
|
|
||||||
ubi_msg("create volume table (copy #%d)", copy + 1);
|
ubi_msg("create volume table (copy #%d)", copy + 1);
|
||||||
|
|
||||||
|
@ -316,15 +315,6 @@ static int create_vtbl(struct ubi_device *ubi, struct ubi_scan_info *si,
|
||||||
if (!vid_hdr)
|
if (!vid_hdr)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
/*
|
|
||||||
* Check if there is a logical eraseblock which would have to contain
|
|
||||||
* this volume table copy was found during scanning. It has to be wiped
|
|
||||||
* out.
|
|
||||||
*/
|
|
||||||
sv = ubi_scan_find_sv(si, UBI_LAYOUT_VOLUME_ID);
|
|
||||||
if (sv)
|
|
||||||
old_seb = ubi_scan_find_seb(sv, copy);
|
|
||||||
|
|
||||||
retry:
|
retry:
|
||||||
new_seb = ubi_scan_get_free_peb(ubi, si);
|
new_seb = ubi_scan_get_free_peb(ubi, si);
|
||||||
if (IS_ERR(new_seb)) {
|
if (IS_ERR(new_seb)) {
|
||||||
|
@ -351,8 +341,8 @@ retry:
|
||||||
goto write_error;
|
goto write_error;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* And add it to the scanning information. Don't delete the old
|
* And add it to the scanning information. Don't delete the old version
|
||||||
* @old_seb as it will be deleted and freed in 'ubi_scan_add_used()'.
|
* of this LEB as it will be deleted and freed in 'ubi_scan_add_used()'.
|
||||||
*/
|
*/
|
||||||
err = ubi_scan_add_used(ubi, si, new_seb->pnum, new_seb->ec,
|
err = ubi_scan_add_used(ubi, si, new_seb->pnum, new_seb->ec,
|
||||||
vid_hdr, 0);
|
vid_hdr, 0);
|
||||||
|
|
Loading…
Reference in New Issue