[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [Qemu-devel] [RFC for-2.7 01/11] qdt: IEEE1275-style devi
From: |
Thomas Huth |
Subject: |
Re: [Qemu-ppc] [Qemu-devel] [RFC for-2.7 01/11] qdt: IEEE1275-style device tree utility code |
Date: |
Wed, 27 Apr 2016 09:06:07 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 |
On 27.04.2016 08:43, Markus Armbruster wrote:
> David Gibson <address@hidden> writes:
>
>> 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 = g_malloc0(sizeof(*prop) + len);
>>>> +
>>>> + prop->name = g_strdup(name);
>>>> + prop->len = 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 drop that?
>>
>> Well.. the idea was that the _ versions are the "internal" ones,
>> whereas external users will generally use the non-underscore version
>
> 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.
>
> Consider getprop_internal() if the length isn't bothersome. It is when
> the name is used all over the place.
>
> do_getprop() would be shorter. I don't like do_verb names myself.
Both ideas also sound fine to me.
Thomas
- [Qemu-ppc] [RFC for-2.7 05/11] pseries: Build device tree only at reset time, (continued)
- [Qemu-ppc] [RFC for-2.7 05/11] pseries: Build device tree only at reset time, David Gibson, 2016/04/19
- [Qemu-ppc] [RFC for-2.7 01/11] qdt: IEEE1275-style device tree utility code, David Gibson, 2016/04/19
- Re: [Qemu-ppc] [RFC for-2.7 01/11] qdt: IEEE1275-style device tree utility code, Alexey Kardashevskiy, 2016/04/21
- Re: [Qemu-ppc] [Qemu-devel] [RFC for-2.7 01/11] qdt: IEEE1275-style device tree utility code, Thomas Huth, 2016/04/26
- Re: [Qemu-ppc] [Qemu-devel] [RFC for-2.7 01/11] qdt: IEEE1275-style device tree utility code, David Gibson, 2016/04/27
- Re: [Qemu-ppc] [Qemu-devel] [RFC for-2.7 01/11] qdt: IEEE1275-style device tree utility code, Markus Armbruster, 2016/04/27
- Re: [Qemu-ppc] [Qemu-devel] [RFC for-2.7 01/11] qdt: IEEE1275-style device tree utility code,
Thomas Huth <=
- Re: [Qemu-ppc] [Qemu-devel] [RFC for-2.7 01/11] qdt: IEEE1275-style device tree utility code, Markus Armbruster, 2016/04/27
- Re: [Qemu-ppc] [Qemu-devel] [RFC for-2.7 01/11] qdt: IEEE1275-style device tree utility code, Thomas Huth, 2016/04/27
- Re: [Qemu-ppc] [Qemu-devel] [RFC for-2.7 01/11] qdt: IEEE1275-style device tree utility code, Markus Armbruster, 2016/04/27
- Re: [Qemu-ppc] [Qemu-devel] [RFC for-2.7 01/11] qdt: IEEE1275-style device tree utility code, David Gibson, 2016/04/27
[Qemu-ppc] [RFC for-2.7 04/11] pseries: Make spapr_create_fdt_skel() get information from machine state, David Gibson, 2016/04/19
[Qemu-ppc] [RFC for-2.7 06/11] pseries: Consolidate RTAS loading, David Gibson, 2016/04/19