Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Dec 2017 04:54:19 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r326484 - head/stand/ofw/libofw
Message-ID:  <201712030454.vB34sJ3J055991@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Sun Dec  3 04:54:18 2017
New Revision: 326484
URL: https://svnweb.freebsd.org/changeset/base/326484

Log:
  Const poison the propname. It's never set and we often pass it const
  char *.
  
  Sponsored by: Netflix

Modified:
  head/stand/ofw/libofw/openfirm.c
  head/stand/ofw/libofw/openfirm.h

Modified: head/stand/ofw/libofw/openfirm.c
==============================================================================
--- head/stand/ofw/libofw/openfirm.c	Sun Dec  3 02:23:29 2017	(r326483)
+++ head/stand/ofw/libofw/openfirm.c	Sun Dec  3 04:54:18 2017	(r326484)
@@ -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 *bu
 
 /* 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 *b
 /* 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;

Modified: head/stand/ofw/libofw/openfirm.h
==============================================================================
--- head/stand/ofw/libofw/openfirm.h	Sun Dec  3 02:23:29 2017	(r326483)
+++ head/stand/ofw/libofw/openfirm.h	Sun Dec  3 04:54:18 2017	(r326484)
@@ -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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201712030454.vB34sJ3J055991>