summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorRicardo Quesada <ricardoq@google.com>2021-08-16 14:36:05 -0700
committerFurquan Shaikh <furquan@google.com>2021-08-31 21:18:18 +0000
commitff236ef8324273cbed4d9dd63f62e8ae2ec82395 (patch)
tree419afa40522dd99322e4567570ab87c67d619cb6 /util
parent83eb22e3b1da42de2ce85a2d458fd1286237a745 (diff)
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>
Diffstat (limited to 'util')
-rw-r--r--util/cbfstool/common.h5
1 files changed, 5 insertions, 0 deletions
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. */