public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [patch] mtd: remove some duplicative checks
@ 2014-02-13 11:21 Dan Carpenter
  2014-02-23  2:27 ` Brian Norris
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2014-02-13 11:21 UTC (permalink / raw)
  To: David Woodhouse; +Cc: kernel-janitors, Brian Norris, linux-mtd

"rc" is an error code here, no need to check it a second time.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/mtd/rfd_ftl.c b/drivers/mtd/rfd_ftl.c
index 233b946e5d66..d1cbf26db2c0 100644
--- a/drivers/mtd/rfd_ftl.c
+++ b/drivers/mtd/rfd_ftl.c
@@ -602,8 +602,7 @@ static int mark_sector_deleted(struct partition *part, u_long old_addr)
 	if (rc) {
 		printk(KERN_ERR PREFIX "error writing '%s' at "
 			"0x%lx\n", part->mbd.mtd->name, addr);
-		if (rc)
-			goto err;
+		goto err;
 	}
 	if (block == part->current_block)
 		part->header_cache[offset + HEADER_MAP_OFFSET] = del;
@@ -675,8 +674,7 @@ static int do_writesect(struct mtd_blktrans_dev *dev, u_long sector, char *buf,
 	if (rc) {
 		printk(KERN_ERR PREFIX "error writing '%s' at 0x%lx\n",
 				part->mbd.mtd->name, addr);
-		if (rc)
-			goto err;
+		goto err;
 	}
 
 	part->sector_map[sector] = addr;
@@ -695,8 +693,7 @@ static int do_writesect(struct mtd_blktrans_dev *dev, u_long sector, char *buf,
 	if (rc) {
 		printk(KERN_ERR PREFIX "error writing '%s' at 0x%lx\n",
 				part->mbd.mtd->name, addr);
-		if (rc)
-			goto err;
+		goto err;
 	}
 	block->used_sectors++;
 	block->free_sectors--;

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

* Re: [patch] mtd: remove some duplicative checks
  2014-02-13 11:21 [patch] mtd: remove some duplicative checks Dan Carpenter
@ 2014-02-23  2:27 ` Brian Norris
  0 siblings, 0 replies; 2+ messages in thread
From: Brian Norris @ 2014-02-23  2:27 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: linux-mtd, kernel-janitors, David Woodhouse

On Thu, Feb 13, 2014 at 02:21:44PM +0300, Dan Carpenter wrote:
> "rc" is an error code here, no need to check it a second time.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Pushed to l2-mtd.git. Thanks!

Brian

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

end of thread, other threads:[~2014-02-23  2:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-13 11:21 [patch] mtd: remove some duplicative checks Dan Carpenter
2014-02-23  2:27 ` Brian Norris

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