From 34ecba1f7616b388ee28490e8a3ed43fb1463011 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 14 Aug 2023 16:40:22 -0600 Subject: abuf: Allow incrementing the size Provide a convenience function to increment the size of the abuf. Signed-off-by: Simon Glass --- include/abuf.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include/abuf.h') diff --git a/include/abuf.h b/include/abuf.h index 9badda64e4f..be98ec78c86 100644 --- a/include/abuf.h +++ b/include/abuf.h @@ -90,6 +90,15 @@ void abuf_map_sysmem(struct abuf *abuf, ulong addr, size_t size); */ bool abuf_realloc(struct abuf *abuf, size_t new_size); +/** + * abuf_realloc_inc() - Increment abuf size by a given amount + * + * @abuf: abuf to adjust + * @inc: Size incrmement to use (the buffer size will be increased by this much) + * Return: true if OK, false if out of memory + */ +bool abuf_realloc_inc(struct abuf *abuf, size_t inc); + /** * abuf_uninit_move() - Return the allocated contents and uninit the abuf * -- cgit v1.2.3