Const poison the propname. It's never set and we often pass it const

char *.

Sponsored by: Netflix
This commit is contained in:
Warner Losh 2017-12-03 04:54:18 +00:00
parent 8433795d66
commit 6df214c520
2 changed files with 8 additions and 8 deletions

View File

@ -242,7 +242,7 @@ OF_instance_to_package(ihandle_t instance)
/* Get the length of a property of a package. */
int
OF_getproplen(phandle_t package, char *propname)
OF_getproplen(phandle_t package, const char *propname)
{
static struct {
cell_t name;
@ -266,7 +266,7 @@ OF_getproplen(phandle_t package, char *propname)
/* Get the value of a property of a package. */
int
OF_getprop(phandle_t package, char *propname, void *buf, int buflen)
OF_getprop(phandle_t package, const char *propname, void *buf, int buflen)
{
static struct {
cell_t name;
@ -294,7 +294,7 @@ OF_getprop(phandle_t package, char *propname, void *buf, int buflen)
/* Get the next property of a package. */
int
OF_nextprop(phandle_t package, char *previous, char *buf)
OF_nextprop(phandle_t package, const char *previous, char *buf)
{
static struct {
cell_t name;
@ -321,7 +321,7 @@ OF_nextprop(phandle_t package, char *previous, char *buf)
/* Set the value of a property of a package. */
/* XXX Has a bug on FirePower */
int
OF_setprop(phandle_t package, char *propname, void *buf, int len)
OF_setprop(phandle_t package, const char *propname, void *buf, int len)
{
static struct {
cell_t name;

View File

@ -89,10 +89,10 @@ phandle_t OF_peer(phandle_t);
phandle_t OF_child(phandle_t);
phandle_t OF_parent(phandle_t);
phandle_t OF_instance_to_package(ihandle_t);
int OF_getproplen(phandle_t, char *);
int OF_getprop(phandle_t, char *, void *, int);
int OF_nextprop(phandle_t, char *, char *);
int OF_setprop(phandle_t, char *, void *, int);
int OF_getproplen(phandle_t, const char *);
int OF_getprop(phandle_t, const char *, void *, int);
int OF_nextprop(phandle_t, const char *, char *);
int OF_setprop(phandle_t, const char *, void *, int);
int OF_canon(const char *, char *, int);
phandle_t OF_finddevice(const char *);
int OF_instance_to_path(ihandle_t, char *, int);