1
0
mirror of git://projects.qi-hardware.com/ben-blinkenlights.git synced 2024-11-23 22:42:49 +02:00

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.
This commit is contained in:
Werner Almesberger 2013-01-26 20:42:33 -03:00
parent 8316bc0070
commit c796ab1c54
2 changed files with 4 additions and 2 deletions

View File

@ -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 */

View File

@ -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;