diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2011-06-03 12:41:00 -0400 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2011-06-07 02:15:55 -0400 |
commit | 4788b60a5faf9f9c9aec10fb7f6b36d9e0f9fa4c (patch) | |
tree | f1c793fad1dd501055ae846960d72924d56c38c3 /drivers/mtd | |
parent | 2a826061df67f205636b953f58f8bede2a3f009c (diff) |
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>
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/ubi/vtbl.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/drivers/mtd/ubi/vtbl.c b/drivers/mtd/ubi/vtbl.c index d704ad275932..4b50a3029b84 100644 --- a/drivers/mtd/ubi/vtbl.c +++ b/drivers/mtd/ubi/vtbl.c | |||
@@ -307,8 +307,7 @@ static int create_vtbl(struct ubi_device *ubi, struct ubi_scan_info *si, | |||
307 | { | 307 | { |
308 | int err, tries = 0; | 308 | int err, tries = 0; |
309 | static struct ubi_vid_hdr *vid_hdr; | 309 | static struct ubi_vid_hdr *vid_hdr; |
310 | struct ubi_scan_volume *sv; | 310 | struct ubi_scan_leb *new_seb; |
311 | struct ubi_scan_leb *new_seb, *old_seb = NULL; | ||
312 | 311 | ||
313 | ubi_msg("create volume table (copy #%d)", copy + 1); | 312 | ubi_msg("create volume table (copy #%d)", copy + 1); |
314 | 313 | ||
@@ -316,15 +315,6 @@ static int create_vtbl(struct ubi_device *ubi, struct ubi_scan_info *si, | |||
316 | if (!vid_hdr) | 315 | if (!vid_hdr) |
317 | return -ENOMEM; | 316 | return -ENOMEM; |
318 | 317 | ||
319 | /* | ||
320 | * Check if there is a logical eraseblock which would have to contain | ||
321 | * this volume table copy was found during scanning. It has to be wiped | ||
322 | * out. | ||
323 | */ | ||
324 | sv = ubi_scan_find_sv(si, UBI_LAYOUT_VOLUME_ID); | ||
325 | if (sv) | ||
326 | old_seb = ubi_scan_find_seb(sv, copy); | ||
327 | |||
328 | retry: | 318 | retry: |
329 | new_seb = ubi_scan_get_free_peb(ubi, si); | 319 | new_seb = ubi_scan_get_free_peb(ubi, si); |
330 | if (IS_ERR(new_seb)) { | 320 | if (IS_ERR(new_seb)) { |
@@ -351,8 +341,8 @@ retry: | |||
351 | goto write_error; | 341 | goto write_error; |
352 | 342 | ||
353 | /* | 343 | /* |
354 | * And add it to the scanning information. Don't delete the old | 344 | * And add it to the scanning information. Don't delete the old version |
355 | * @old_seb as it will be deleted and freed in 'ubi_scan_add_used()'. | 345 | * of this LEB as it will be deleted and freed in 'ubi_scan_add_used()'. |
356 | */ | 346 | */ |
357 | err = ubi_scan_add_used(ubi, si, new_seb->pnum, new_seb->ec, | 347 | err = ubi_scan_add_used(ubi, si, new_seb->pnum, new_seb->ec, |
358 | vid_hdr, 0); | 348 | vid_hdr, 0); |