diff options
| author | Simon Glass <[email protected]> | 2025-01-10 17:00:03 -0700 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2025-01-22 15:58:03 -0600 |
| commit | 7ba7c1dd86cf212c7d489dbf0a07301d1a3b4d2c (patch) | |
| tree | 3a642d4e47b8d0439248966cfa1eb981133c872a /lib/abuf.c | |
| parent | d887432807af8bdc943e7c8caa2a528dc516f6b3 (diff) | |
abuf: Provide a constant buffer
Add a new initialiser which can accept a constant pointer.
Signed-off-by: Simon Glass <[email protected]>
Diffstat (limited to 'lib/abuf.c')
| -rw-r--r-- | lib/abuf.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/abuf.c b/lib/abuf.c index 8156177c773..61adf7fc6b1 100644 --- a/lib/abuf.c +++ b/lib/abuf.c @@ -119,6 +119,12 @@ void abuf_init_set(struct abuf *abuf, void *data, size_t size) abuf_set(abuf, data, size); } +void abuf_init_const(struct abuf *abuf, const void *data, size_t size) +{ + /* for now there is no flag indicating that the abuf data is constant */ + abuf_init_set(abuf, (void *)data, size); +} + void abuf_init_move(struct abuf *abuf, void *data, size_t size) { abuf_init_set(abuf, data, size); |
