From 79199e25f1d6fa71bf3a6ff05ae7d16fe0cffe2f Mon Sep 17 00:00:00 2001 From: zhaoxingyu1 Date: Thu, 29 Aug 2024 19:57:17 +0800 Subject: [PATCH] mtd/nvs: fix align size when gc, move data requires byte alignment Signed-off-by: zhaoxingyu1 --- drivers/mtd/mtd_config_fs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/mtd_config_fs.c b/drivers/mtd/mtd_config_fs.c index 411ca204e0..11a1349d57 100644 --- a/drivers/mtd/mtd_config_fs.c +++ b/drivers/mtd/mtd_config_fs.c @@ -62,7 +62,7 @@ * so we make a buffer to do compare or move. */ -#define NVS_BUFFER_SIZE 32 +#define NVS_BUFFER_SIZE MAX(NVS_ALIGN_UP(32), NVS_ALIGN_SIZE) /* If data is written after last ate, and power loss happens, * we need to find a clean offset by skipping dirty data.