libpayload: Add const for dma_coherent argument

Add the const modifier for the ptr argument of dma_coherent to avoid
unnecessary type casting in payloads.

BUG=none
TEST=emerge-corsola libpayload
BRANCH=none

Change-Id: Ic4bb1d8318c7e83fd3ab3054aa0333cb27afe588
Signed-off-by: Yu-Ping Wu <yupingso@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/66961
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Hsin-Te Yuan <yuanhsinte@google.com>
This commit is contained in:
Yu-Ping Wu 2022-08-23 16:40:03 +08:00 committed by Tim Wawrzynczak
parent 403d22076c
commit 30d8e724e7
2 changed files with 2 additions and 2 deletions

View File

@ -136,7 +136,7 @@ void print_malloc_map(void);
void init_dma_memory(void *start, u32 size);
int dma_initialized(void);
int dma_coherent(void *ptr);
int dma_coherent(const void *ptr);
static inline void *xmalloc_work(size_t size, const char *file,
const char *func, int line)

View File

@ -118,7 +118,7 @@ int dma_initialized()
}
/* For boards that don't initialize DMA we assume all locations are coherent */
int dma_coherent(void *ptr)
int dma_coherent(const void *ptr)
{
return !dma_initialized() || (dma->start <= ptr && dma->end > ptr);
}