diff mbox

[05/14] mtd: nand: remove unnecessary variable

Message ID 1315426421-16243-6-git-send-email-computersforpeace@gmail.com
State Accepted
Commit 1196ac5a9969f180c67e9a4454384250ab034452
Headers show

Commit Message

Brian Norris Sept. 7, 2011, 8:13 p.m. UTC
`writeops' is unnecessary in the function `nand_update_bbt()'

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
---
 drivers/mtd/nand/nand_bbt.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

Comments

Artem Bityutskiy Sept. 11, 2011, 1:58 p.m. UTC | #1
On Wed, 2011-09-07 at 13:13 -0700, Brian Norris wrote:
> `writeops' is unnecessary in the function `nand_update_bbt()'
> 
> Signed-off-by: Brian Norris <computersforpeace@gmail.com>

Pushed to my tree, thanks!
diff mbox

Patch

diff --git a/drivers/mtd/nand/nand_bbt.c b/drivers/mtd/nand/nand_bbt.c
index 03d76c5..b493f51 100644
--- a/drivers/mtd/nand/nand_bbt.c
+++ b/drivers/mtd/nand/nand_bbt.c
@@ -1171,7 +1171,7 @@  int nand_scan_bbt(struct mtd_info *mtd, struct nand_bbt_descr *bd)
 int nand_update_bbt(struct mtd_info *mtd, loff_t offs)
 {
 	struct nand_chip *this = mtd->priv;
-	int len, res = 0, writeops = 0;
+	int len, res = 0;
 	int chip, chipsel;
 	uint8_t *buf;
 	struct nand_bbt_descr *td = this->bbt_td;
@@ -1187,8 +1187,6 @@  int nand_update_bbt(struct mtd_info *mtd, loff_t offs)
 	if (!buf)
 		return -ENOMEM;
 
-	writeops = md != NULL ? 0x03 : 0x01;
-
 	/* Do we have a bbt per chip? */
 	if (td->options & NAND_BBT_PERCHIP) {
 		chip = (int)(offs >> this->chip_shift);
@@ -1203,13 +1201,13 @@  int nand_update_bbt(struct mtd_info *mtd, loff_t offs)
 		md->version[chip]++;
 
 	/* Write the bad block table to the device? */
-	if ((writeops & 0x01) && (td->options & NAND_BBT_WRITE)) {
+	if (td->options & NAND_BBT_WRITE) {
 		res = write_bbt(mtd, buf, td, md, chipsel);
 		if (res < 0)
 			goto out;
 	}
 	/* Write the mirror bad block table to the device? */
-	if ((writeops & 0x02) && md && (md->options & NAND_BBT_WRITE)) {
+	if (md && (md->options & NAND_BBT_WRITE)) {
 		res = write_bbt(mtd, buf, md, td, chipsel);
 	}