From owner-svn-src-head@freebsd.org Sun Dec 3 04:54:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54A95DEDF3E; Sun, 3 Dec 2017 04:54:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E6206A6D2; Sun, 3 Dec 2017 04:54:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vB34sJ6E055993; Sun, 3 Dec 2017 04:54:19 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vB34sJ3J055991; Sun, 3 Dec 2017 04:54:19 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712030454.vB34sJ3J055991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 3 Dec 2017 04:54:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326484 - head/stand/ofw/libofw X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/ofw/libofw X-SVN-Commit-Revision: 326484 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Dec 2017 04:54:20 -0000 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);