Attention is currently required from: Julius Werner. Raul Rangel has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/56002 )
Change subject: lib/cbfs,commonlib/mem_pool: Make cbfs_free take const pointer ......................................................................
lib/cbfs,commonlib/mem_pool: Make cbfs_free take const pointer
BUG=b:177909625 TEST=Compile
Signed-off-by: Raul E Rangel rrangel@chromium.org Change-Id: Ie570825f9255d6499e977f6eace58589115e2552 --- M src/commonlib/include/commonlib/mem_pool.h M src/commonlib/mem_pool.c M src/include/cbfs.h M src/lib/cbfs.c 4 files changed, 4 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/02/56002/1
diff --git a/src/commonlib/include/commonlib/mem_pool.h b/src/commonlib/include/commonlib/mem_pool.h index 6c85397..4ed1aa1 100644 --- a/src/commonlib/include/commonlib/mem_pool.h +++ b/src/commonlib/include/commonlib/mem_pool.h @@ -57,6 +57,6 @@ void *mem_pool_alloc(struct mem_pool *mp, size_t sz);
/* Free allocation from memory pool. */ -void mem_pool_free(struct mem_pool *mp, void *alloc); +void mem_pool_free(struct mem_pool *mp, const void *alloc);
#endif /* _MEM_POOL_H_ */ diff --git a/src/commonlib/mem_pool.c b/src/commonlib/mem_pool.c index c300c65..0feef03 100644 --- a/src/commonlib/mem_pool.c +++ b/src/commonlib/mem_pool.c @@ -23,7 +23,7 @@ return p; }
-void mem_pool_free(struct mem_pool *mp, void *p) +void mem_pool_free(struct mem_pool *mp, const void *p) { /* Determine if p was the most recent allocation. */ if (p == NULL || mp->last_alloc != p) diff --git a/src/include/cbfs.h b/src/include/cbfs.h index 9ed5233..6e08438 100644 --- a/src/include/cbfs.h +++ b/src/include/cbfs.h @@ -99,7 +99,7 @@
/* Removes a previously allocated CBFS mapping. Should try to unmap mappings in strict LIFO order where possible, since mapping backends often don't support more complicated cases. */ -void cbfs_unmap(void *mapping); +void cbfs_unmap(const void *mapping);
/* Load stage into memory filling in prog. Return 0 on success. < 0 on error. */ int cbfs_prog_stage_load(struct prog *prog); diff --git a/src/lib/cbfs.c b/src/lib/cbfs.c index 32ebfaf..3247278 100644 --- a/src/lib/cbfs.c +++ b/src/lib/cbfs.c @@ -102,7 +102,7 @@ return 0; }
-void cbfs_unmap(void *mapping) +void cbfs_unmap(const void *mapping) { /* * This is save to call with mappings that weren't allocated in the cache (e.g. x86