Skip to content

Commit

Permalink
mtd: remove some duplicative checks
Browse files Browse the repository at this point in the history
"rc" is an error code here, no need to check it a second time.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
  • Loading branch information
Dan Carpenter authored and Brian Norris committed Mar 11, 2014
1 parent 74414a9 commit da22b89
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions drivers/mtd/rfd_ftl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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--;
Expand Down

0 comments on commit da22b89

Please sign in to comment.