Browse Source

libfdt: Make fdt_string() return a const pointer

Currently, fdt_string() returns a (non-const) char *, despite taking a
const void *fdt.  This is inconsistent with all the other read-only
functions which all return const pointers into the blob.

This patch fixes that.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
main
David Gibson 17 years ago committed by Jon Loeliger
parent
commit
11d5302021
  1. 2
      libfdt/fdt_ro.c
  2. 2
      libfdt/libfdt.h

2
libfdt/fdt_ro.c

@ -82,7 +82,7 @@ static int nodename_eq(const void *fdt, int offset, @@ -82,7 +82,7 @@ static int nodename_eq(const void *fdt, int offset,
return 0;
}

char *fdt_string(const void *fdt, int stroffset)
const char *fdt_string(const void *fdt, int stroffset)
{
return (char *)fdt + fdt_off_dt_strings(fdt) + stroffset;
}

2
libfdt/libfdt.h

@ -110,7 +110,7 @@ static inline void *fdt_offset_ptr_w(void *fdt, int offset, int checklen) @@ -110,7 +110,7 @@ static inline void *fdt_offset_ptr_w(void *fdt, int offset, int checklen)
int fdt_move(const void *fdt, void *buf, int bufsize);

/* Read-only functions */
char *fdt_string(const void *fdt, int stroffset);
const char *fdt_string(const void *fdt, int stroffset);

int fdt_get_mem_rsv(const void *fdt, int n, uint64_t *address, uint64_t *size);
int fdt_num_mem_rsv(const void *fdt);

Loading…
Cancel
Save