Merge tag 'efi-2020-07-rc6' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
[oweals/u-boot.git] / drivers / mtd / nand / raw / atmel_nand.c
index a5b76e1aa05d26dd5148b3ee95c10bd126d3dae7..5e95901e275169efe85755547cb7486fd122585c 100644 (file)
  */
 
 #include <common.h>
+#include <log.h>
 #include <asm/gpio.h>
 #include <asm/arch/gpio.h>
+#include <dm/device_compat.h>
+#include <dm/devres.h>
+#include <linux/bitops.h>
+#include <linux/bug.h>
+#include <linux/delay.h>
 
 #include <malloc.h>
 #include <nand.h>
@@ -249,7 +255,7 @@ static void pmecc_get_sigma(struct mtd_info *mtd)
        int diff;
 
        /* Init the Sigma(x) */
-       memset(smu, 0, sizeof(int16_t) * ARRAY_SIZE(smu));
+       memset(smu, 0, sizeof(int16_t) * num * (cap + 2));
 
        dmu_0_count = 0;