From c796ab1c548dc20f9d9c1242c1d4c17d30136ec3 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Sat, 26 Jan 2013 20:42:33 -0300 Subject: [PATCH] libubb/physmem.c (physmem_xlat): make "v" "const" Since we may use the buffer as well for reading only, there is no point in pretending physmem_xlat itself would try to write to it. --- libubb/include/ubb/physmem.h | 3 ++- libubb/physmem.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libubb/include/ubb/physmem.h b/libubb/include/ubb/physmem.h index 442a12b..0a4114d 100644 --- a/libubb/include/ubb/physmem.h +++ b/libubb/include/ubb/physmem.h @@ -24,7 +24,8 @@ struct physmem_vec { void *physmem_malloc(size_t size); void *physmem_calloc(size_t size); -int physmem_xlat(void *v, size_t len, struct physmem_vec *vec, int vec_len); +int physmem_xlat(const void *v, size_t len, + struct physmem_vec *vec, int vec_len); int physmem_flush(const void *data, size_t size); #endif /* !UBB_PHYSMEM_H */ diff --git a/libubb/physmem.c b/libubb/physmem.c index cd25a5b..db4de06 100644 --- a/libubb/physmem.c +++ b/libubb/physmem.c @@ -130,7 +130,8 @@ static unsigned long xlat_one(int fd, unsigned long vaddr) } -int physmem_xlat(void *v, size_t len, struct physmem_vec *vec, int vec_len) +int physmem_xlat(const void *v, size_t len, + struct physmem_vec *vec, int vec_len) { static int fd = -1; unsigned long vaddr = (unsigned long) v;