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 <ricardoq@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/56987
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
This commit is contained in:
Ricardo Quesada 2021-08-16 14:36:05 -07:00 committed by Furquan Shaikh
parent 83eb22e3b1
commit ff236ef832
1 changed files with 5 additions and 0 deletions

View File

@ -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. */