From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58942) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1avJYG-00062y-Rs for qemu-devel@nongnu.org; Wed, 27 Apr 2016 03:06:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1avJYD-0007j1-Kb for qemu-devel@nongnu.org; Wed, 27 Apr 2016 03:06:24 -0400 References: <1461119601-4936-1-git-send-email-david@gibson.dropbear.id.au> <1461119601-4936-2-git-send-email-david@gibson.dropbear.id.au> <571F4A36.7060106@redhat.com> <20160427060252.GB18476@voom.redhat.com> <87bn4v362f.fsf@dusky.pond.sub.org> From: Thomas Huth Message-ID: <572064DF.6030802@redhat.com> Date: Wed, 27 Apr 2016 09:06:07 +0200 MIME-Version: 1.0 In-Reply-To: <87bn4v362f.fsf@dusky.pond.sub.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RFC for-2.7 01/11] qdt: IEEE1275-style device tree utility code List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , David Gibson Cc: crosthwaite.peter@gmail.com, aik@ozlabs.ru, qemu-devel@nongnu.org, agraf@suse.de, qemu-ppc@nongnu.org On 27.04.2016 08:43, Markus Armbruster wrote: > David Gibson writes: >=20 >> On Tue, Apr 26, 2016 at 01:00:06PM +0200, Thomas Huth wrote: >>> On 20.04.2016 04:33, David Gibson wrote: [...] >>>> +/* >>>> + * Property functions >>>> + */ >>>> + >>>> +QDTProperty *qdt_new_property(const gchar *name, gconstpointer val,= gsize len) >>>> +{ >>>> + QDTProperty *prop =3D g_malloc0(sizeof(*prop) + len); >>>> + >>>> + prop->name =3D g_strdup(name); >>>> + prop->len =3D len; >>>> + memcpy(prop->val, val, len); >>>> + return prop; >>>> +} >>>> + >>>> +static QDTProperty *getprop_(const QDTNode *node, const gchar *name= ) >>> >>> Underscore at the end looks somewhat strange ... can't you simply dro= p that? >> >> Well.. the idea was that the _ versions are the "internal" ones, >> whereas external users will generally use the non-underscore version >=20 > I've seen that convention used before. It's fine with me. Can't remember to have seen that convention before ... I know that some people use the underscore at the beginning to mark an internal function, but at the end? So if you really want to use the underscore, what about putting it at the beginning instead? >> (in this case the only difference is that the external one returns a >> const pointer). >> >> I don't particularly like that convention, so feel free to suggest >> something better. >=20 > Consider getprop_internal() if the length isn't bothersome. It is when > the name is used all over the place. >=20 > do_getprop() would be shorter. I don't like do_verb names myself. Both ideas also sound fine to me. Thomas