diff options
author | Brian Norris <computersforpeace@gmail.com> | 2011-09-07 16:13:32 -0400 |
---|---|---|
committer | Artem Bityutskiy <artem.bityutskiy@intel.com> | 2011-09-11 09:57:49 -0400 |
commit | 1196ac5a9969f180c67e9a4454384250ab034452 (patch) | |
tree | fa155c235b1f81e08631ea5d9f4218941b527193 /drivers | |
parent | afa17de262633603dd65f89e9370f48e56b8c557 (diff) |
mtd: nand: remove unnecessary variable
`writeops' is unnecessary in the function `nand_update_bbt()'
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mtd/nand/nand_bbt.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/mtd/nand/nand_bbt.c b/drivers/mtd/nand/nand_bbt.c index fcfaf06beaaf..c1074ac9bdac 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) | |||
1171 | int nand_update_bbt(struct mtd_info *mtd, loff_t offs) | 1171 | int nand_update_bbt(struct mtd_info *mtd, loff_t offs) |
1172 | { | 1172 | { |
1173 | struct nand_chip *this = mtd->priv; | 1173 | struct nand_chip *this = mtd->priv; |
1174 | int len, res = 0, writeops = 0; | 1174 | int len, res = 0; |
1175 | int chip, chipsel; | 1175 | int chip, chipsel; |
1176 | uint8_t *buf; | 1176 | uint8_t *buf; |
1177 | struct nand_bbt_descr *td = this->bbt_td; | 1177 | struct nand_bbt_descr *td = this->bbt_td; |
@@ -1187,8 +1187,6 @@ int nand_update_bbt(struct mtd_info *mtd, loff_t offs) | |||
1187 | if (!buf) | 1187 | if (!buf) |
1188 | return -ENOMEM; | 1188 | return -ENOMEM; |
1189 | 1189 | ||
1190 | writeops = md != NULL ? 0x03 : 0x01; | ||
1191 | |||
1192 | /* Do we have a bbt per chip? */ | 1190 | /* Do we have a bbt per chip? */ |
1193 | if (td->options & NAND_BBT_PERCHIP) { | 1191 | if (td->options & NAND_BBT_PERCHIP) { |
1194 | chip = (int)(offs >> this->chip_shift); | 1192 | chip = (int)(offs >> this->chip_shift); |
@@ -1203,13 +1201,13 @@ int nand_update_bbt(struct mtd_info *mtd, loff_t offs) | |||
1203 | md->version[chip]++; | 1201 | md->version[chip]++; |
1204 | 1202 | ||
1205 | /* Write the bad block table to the device? */ | 1203 | /* Write the bad block table to the device? */ |
1206 | if ((writeops & 0x01) && (td->options & NAND_BBT_WRITE)) { | 1204 | if (td->options & NAND_BBT_WRITE) { |
1207 | res = write_bbt(mtd, buf, td, md, chipsel); | 1205 | res = write_bbt(mtd, buf, td, md, chipsel); |
1208 | if (res < 0) | 1206 | if (res < 0) |
1209 | goto out; | 1207 | goto out; |
1210 | } | 1208 | } |
1211 | /* Write the mirror bad block table to the device? */ | 1209 | /* Write the mirror bad block table to the device? */ |
1212 | if ((writeops & 0x02) && md && (md->options & NAND_BBT_WRITE)) { | 1210 | if (md && (md->options & NAND_BBT_WRITE)) { |
1213 | res = write_bbt(mtd, buf, md, td, chipsel); | 1211 | res = write_bbt(mtd, buf, md, td, chipsel); |
1214 | } | 1212 | } |
1215 | 1213 | ||