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.
libfdt/fdt_ro.c +1 -1
@@ -82,7 +82,7 @@ static int nodename_eq(const void *fdt,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; }
libfdt/libfdt.h +1 -1
@@ -110,7 +110,7 @@ static inline void *fdt_offset_ptr_w(voiint 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);
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
Jon Loeliger
AppliedSo, like, the other day David Gibson mumbled:
Quoted 7 lines
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 <[email protected]>
Applied.
jdl
Quoted 10 lines · Jon Loeliger
So, like, the other day David Gibson mumbled:
Quoted 7 lines
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 <[email protected]>Applied.
But apparently not pushed out to the public tree...
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
So, like, the other day David Gibson mumbled:
Quoted 4 lines
Quoted 2 lines
Applied.
But apparently not pushed out to the public tree...
Oh, sorry. I got side-tracked...
Coming up...
jdl