From: David Gibson <david@gibson.dropbear.id.au>
To: Jon Loeliger <jdl@freescale.com>
Cc: linuxppc-dev@ozlabs.org
Subject: libfdt: Make fdt_string() return a const pointer
Date: Thu, 18 Oct 2007 12:10:42 +1000 [thread overview]
Message-ID: <20071018021042.GC24236@localhost.localdomain> (raw)
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>
Index: dtc/libfdt/fdt_ro.c
===================================================================
--- dtc.orig/libfdt/fdt_ro.c 2007-10-17 17:35:49.000000000 +1000
+++ dtc/libfdt/fdt_ro.c 2007-10-17 17:35:50.000000000 +1000
@@ -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;
}
Index: dtc/libfdt/libfdt.h
===================================================================
--- dtc.orig/libfdt/libfdt.h 2007-10-17 17:35:35.000000000 +1000
+++ dtc/libfdt/libfdt.h 2007-10-17 17:35:36.000000000 +1000
@@ -110,7 +110,7 @@ static inline void *fdt_offset_ptr_w(voi
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);
--
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
next reply other threads:[~2007-10-18 2:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-18 2:10 David Gibson [this message]
2007-10-22 16:37 ` libfdt: Make fdt_string() return a const pointer Jon Loeliger
2007-10-23 3:21 ` David Gibson
2007-10-23 13:54 ` Jon Loeliger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071018021042.GC24236@localhost.localdomain \
--to=david@gibson.dropbear.id.au \
--cc=jdl@freescale.com \
--cc=linuxppc-dev@ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).