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

Item size is calculated according to the actual space used

Change-Id: I7e4ce774a16d665a33e411991dc6dc767e1aba93
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
This commit is contained in:
Jon Lin
2021-04-28 14:33:02 +08:00
committed by Tao Huang
parent d753ba89d8
commit a7adc7ec80

View File

@@ -174,8 +174,7 @@ static int flash_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,