Skip to content

Commit

Permalink
UBI: remove dead code
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Artem Bityutskiy authored and Artem Bityutskiy committed Jun 7, 2011
1 parent 2a82606 commit 4788b60
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions drivers/mtd/ubi/vtbl.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,24 +307,14 @@ static int create_vtbl(struct ubi_device *ubi, struct ubi_scan_info *si,
{
int err, tries = 0;
static struct ubi_vid_hdr *vid_hdr;
struct ubi_scan_volume *sv;
struct ubi_scan_leb *new_seb, *old_seb = NULL;
struct ubi_scan_leb *new_seb;

ubi_msg("create volume table (copy #%d)", copy + 1);

vid_hdr = ubi_zalloc_vid_hdr(ubi, GFP_KERNEL);
if (!vid_hdr)
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:
new_seb = ubi_scan_get_free_peb(ubi, si);
if (IS_ERR(new_seb)) {
Expand All @@ -351,8 +341,8 @@ static int create_vtbl(struct ubi_device *ubi, struct ubi_scan_info *si,
goto write_error;

/*
* And add it to the scanning information. Don't delete the old
* @old_seb as it will be deleted and freed in 'ubi_scan_add_used()'.
* And add it to the scanning information. Don't delete the old version
* 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,
vid_hdr, 0);
Expand Down

0 comments on commit 4788b60

Please sign in to comment.