Skip to contentSkip to conversation

mtd: ubi: wl: remove set but not used variable 'prev_e'

PATCH Applied YueHaibing 2 participants 2 messages Nov 27, 2019 – Jan 16, 2020

Subsystems (3)
lore
Share & tools
lore

YueHaibing

author
#0 lore raw

PATCH 1/1 mtd: ubi: wl: remove set but not used variable 'prev_e'

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/mtd/ubi/wl.c: In function 'find_wl_entry':
drivers/mtd/ubi/wl.c:322:27: warning:
variable 'prev_e' set but not used [-Wunused-but-set-variable]

It's not used any more now, so remove it.

Fixes f9c34bb52997 ("ubi: Fix producing anchor PEBs")
---
 drivers/mtd/ubi/wl.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/mtd/ubi/wl.c +1 -2
index 5d77a38dba54..837d690a8c60 100644
@@ -319,7 +319,7 @@ static struct ubi_wl_entry *find_wl_entry(struct ubi_device *ubi,
 					  struct rb_root *root, int diff)
 {
 	struct rb_node *p;
-	struct ubi_wl_entry *e, *prev_e = NULL;
+	struct ubi_wl_entry *e;
 	int max;
 
 	e = rb_entry(rb_first(root), struct ubi_wl_entry, u.rb);
@@ -334,7 +334,6 @@ static struct ubi_wl_entry *find_wl_entry(struct ubi_device *ubi,
 			p = p->rb_left;
 		else {
 			p = p->rb_right;
-			prev_e = e;
 			e = e1;
 		}
 	}
#1 lore raw
Quoted 7 lines · YueHaibing

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/mtd/ubi/wl.c: In function 'find_wl_entry':
drivers/mtd/ubi/wl.c:322:27: warning:
variable 'prev_e' set but not used [-Wunused-but-set-variable]

Quoted 7 lines

It's not used any more now, so remove it.

Fixes f9c34bb52997 ("ubi: Fix producing anchor PEBs")
---
 drivers/mtd/ubi/wl.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Applied. Thanks!

Signature · 2 lines
Thanks,
//richard