mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] ubiformat: remove dead code
@ 2015-09-24 14:28 Jan Remmet
  2015-09-29  6:41 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Remmet @ 2015-09-24 14:28 UTC (permalink / raw)
  To: barebox

divisor isn't used.

Signed-off-by: Jan Remmet <j.remmet@phytec.de>
---
 commands/ubiformat.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/commands/ubiformat.c b/commands/ubiformat.c
index f9d952c..8516e11 100644
--- a/commands/ubiformat.c
+++ b/commands/ubiformat.c
@@ -297,7 +297,7 @@ static int mark_bad(const struct mtd_dev_info *mtd, struct ubi_scan_info *si, in
 static int flash_image(const struct mtd_dev_info *mtd,
 		       const struct ubigen_info *ui, struct ubi_scan_info *si)
 {
-	int fd, img_ebs, eb, written_ebs = 0, divisor, ret = -1;
+	int fd, img_ebs, eb, written_ebs = 0, ret = -1;
 	off_t st_size;
 	char *buf = NULL;
 
@@ -332,7 +332,6 @@ static int flash_image(const struct mtd_dev_info *mtd,
 	}
 
 	verbose(args.verbose, "will write %d eraseblocks", img_ebs);
-	divisor = img_ebs;
 	for (eb = 0; eb < mtd->eb_cnt; eb++) {
 		int err, new_len;
 		long long ec;
@@ -342,10 +341,8 @@ static int flash_image(const struct mtd_dev_info *mtd,
 			       eb, (eb + 1) * 100 / mtd->eb_cnt);
 		}
 
-		if (si->ec[eb] == EB_BAD) {
-			divisor += 1;
+		if (si->ec[eb] == EB_BAD)
 			continue;
-		}
 
 		if (args.verbose) {
 			normsg_cont("eraseblock %d: erase", eb);
-- 
1.9.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] ubiformat: remove dead code
  2015-09-24 14:28 [PATCH] ubiformat: remove dead code Jan Remmet
@ 2015-09-29  6:41 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2015-09-29  6:41 UTC (permalink / raw)
  To: Jan Remmet; +Cc: barebox

On Thu, Sep 24, 2015 at 04:28:18PM +0200, Jan Remmet wrote:
> divisor isn't used.
> 
> Signed-off-by: Jan Remmet <j.remmet@phytec.de>
> ---
>  commands/ubiformat.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)

Applied, thanks

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-09-29  6:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-24 14:28 [PATCH] ubiformat: remove dead code Jan Remmet
2015-09-29  6:41 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox