soc: rockchip: mtd_vendor_storage: Change vendor storage item size realloc strategy

Item size is calculated according to the actual space used

Change-Id: I7133368130689f792f05e82fea04ebf16a755a37
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
This commit is contained in:
Jon Lin
2021-05-10 10:02:25 +08:00
committed by Tao Huang
parent a7adc7ec80
commit e63a36dcb0

View File

@@ -259,8 +259,7 @@ static int mtd_vendor_write(u32 id, void *pbuf, u32 size)
item->size = size;
memcpy(&p_data[item->offset], pbuf, size);
g_vendor->free_offset = offset + align_size;
g_vendor->free_size -= (align_size -
alloc_size);
g_vendor->free_size = sizeof(g_vendor->data) - g_vendor->free_offset;
} else {
memcpy(&p_data[item->offset],
pbuf,