ramips: mt7621_nand: fix writing upper half of fdm data
authorFelix Fietkau <nbd@nbd.name>
Wed, 12 Jan 2022 19:56:04 +0000 (20:56 +0100)
committerFelix Fietkau <nbd@nbd.name>
Thu, 13 Jan 2022 17:33:06 +0000 (18:33 +0100)
Since the loop iterates from 0-3, subtracting 4 from the shift
multiplier does not make any sense

Signed-off-by: Felix Fietkau <nbd@nbd.name>
target/linux/ramips/patches-5.10/410-mtd-rawnand-add-driver-support-for-MT7621-nand-flash.patch

index a37426edecf944a060b2ff70d7da35218cc21c99..8049dbde142b9d22e925e13274bfe57db3e8de6d 100644 (file)
@@ -1022,7 +1022,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
 +                      vall |= (u32)oobptr[j] << (j * 8);
 +
 +              for (j = 0; j < 4; j++)
-+                      valm |= (u32)oobptr[j + 4] << ((j - 4) * 8);
++                      valm |= (u32)oobptr[j + 4] << (j * 8);
 +
 +              nfi_write32(nfc, NFI_FDML(i), vall);
 +              nfi_write32(nfc, NFI_FDMM(i), valm);