[][OpenWrt Dev][Suppress meanless bitflip correction log of mtk-snand driver]

[Description]
Fix mtk-snand driver that prints meanless bitflip correction log in mt7986

Due to design change of SNFI in mt7986, the HW will no longer treate full
0xff page (empty page) as ecc-corrected. Instead, the HW will report ecc
error for these pages, and will result in empty page bitflip detection
mechanism being applied for these pages.

Since these pages have no bitflip, the mechanism will report 0 bitflip
corrected, which is totally meanless. So this patch change the mechanism
to report bitflips only when there is actually bitflip detected.

[Release-log]
N/A

Change-Id: I7c5dd5f7910501d6a4af1a469df27997d3fe6c00
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/4559029
diff --git a/target/linux/mediatek/files-5.4/drivers/mtd/mtk-snand/mtk-snand.c b/target/linux/mediatek/files-5.4/drivers/mtd/mtk-snand/mtk-snand.c
index 0dacf4f..6d57d56 100644
--- a/target/linux/mediatek/files-5.4/drivers/mtd/mtk-snand/mtk-snand.c
+++ b/target/linux/mediatek/files-5.4/drivers/mtd/mtk-snand/mtk-snand.c
@@ -696,7 +696,7 @@
 			snand_log_ecc(snf->pdev,
 			      "Uncorrectable bitflips in page %u sect %u\n",
 			      page, i);
-		} else {
+		} else if (rc) {
 			snf->sect_bf[i] = rc;
 
 			if (snf->sect_bf[i] > max_bitflips)
@@ -705,6 +705,8 @@
 			snand_log_ecc(snf->pdev,
 			      "%u bitflip%s corrected in page %u sect %u\n",
 			      rc, rc > 1 ? "s" : "", page, i);
+		} else {
+			snf->sect_bf[i] = 0;
 		}
 	}