[PATCH] nvmem: imx-ocotp-ele: correct ELE fuse check
Peng Fan (OSS)
peng.fan at oss.nxp.com
Thu Aug 8 06:53:52 PDT 2024
From: Peng Fan <peng.fan at nxp.com>
"type | FUSE_ECC" will be always true. To check whether the fuse is ECC
fuse, need use "type & FUSE_ECC"
Reported-by: kernel test robot <lkp at intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202408080514.wuSJ2V3A-lkp@intel.com/
Signed-off-by: Peng Fan <peng.fan at nxp.com>
---
V1:
Fixes tag not added, because it is still in next tree.
My yocto toolchain not report build warning. But this is a silly bug that
I just see there is value out and suppose it is correct. The value was indeed
correct, but only the lower half.
drivers/nvmem/imx-ocotp-ele.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/nvmem/imx-ocotp-ele.c b/drivers/nvmem/imx-ocotp-ele.c
index 4f22310920a2..1ba494497698 100644
--- a/drivers/nvmem/imx-ocotp-ele.c
+++ b/drivers/nvmem/imx-ocotp-ele.c
@@ -94,7 +94,7 @@ static int imx_ocotp_reg_read(void *context, unsigned int offset, void *val, siz
continue;
}
- if (type | FUSE_ECC)
+ if (type & FUSE_ECC)
*buf++ = readl_relaxed(reg + (i << 2)) & GENMASK(15, 0);
else
*buf++ = readl_relaxed(reg + (i << 2));
--
2.37.1
More information about the linux-arm-kernel
mailing list