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>
This commit is contained in:
parent
5a98ddd10a
commit
11d5302021
2 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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…
Reference in a new issue