From ff236ef8324273cbed4d9dd63f62e8ae2ec82395 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Mon, 16 Aug 2021 14:36:05 -0700 Subject: cbfstool: add buffer_end() to common.h Add buffer_end() function to common.h. This function returns a pointer to the end of the buffer (exclusive). This is needed by elogtool util. (See the next CL in the chain). BUG=b:172210863 Change-Id: I380eecbc89c13f5fe5ab4c31d7a4fef97690a791 Signed-off-by: Ricardo Quesada Reviewed-on: https://review.coreboot.org/c/coreboot/+/56987 Tested-by: build bot (Jenkins) Reviewed-by: Furquan Shaikh --- util/cbfstool/common.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'util/cbfstool') diff --git a/util/cbfstool/common.h b/util/cbfstool/common.h index 1c25a66a68..07ffdf8231 100644 --- a/util/cbfstool/common.h +++ b/util/cbfstool/common.h @@ -54,6 +54,11 @@ static inline size_t buffer_offset(const struct buffer *b) return b->offset; } +static inline void *buffer_end(const struct buffer *b) +{ + return b->data + b->size; +} + /* * Shrink a buffer toward the beginning of its previous space. * Afterward, buffer_delete() remains the means of cleaning it up. */ -- cgit v1.2.3