Skip to contentSkip to conversation

fixing rightshift in nand_block_bad

PATCH New Vitaly Wool 1 participant 1 message Oct 26, 2005 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fixing rightshift in nand_block_bad

As was discussed in the IRC chat, it's necessary to shift value obtained read_word from right by 8 in case of odd this->badblockpos. The patch from that is inlined below.

Best regards,
Vitaly

Index: drivers/mtd/nand/nand_base.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/nand/nand_base.c,v retrieving revision 1.150

mtd/nand/nand_base.c +1 -1
diff -u -r1.150 nand_base.c
@@ -433,7 +433,7 @@
 		this->cmdfunc (mtd, NAND_CMD_READOOB, this->badblockpos & 0xFE, page & this->pagemask);
 		bad = cpu_to_le16(this->read_word(mtd));
 		if (this->badblockpos & 0x1)
-			bad >>= 1;
+			bad >>= 8;
 		if ((bad & 0xFF) != 0xff)
 			res = 1;
 	} else {