[PATCH 01/14] fdt: Tidy up a few fdtdec problems

Simon Glass sjg at chromium.org
Fri Dec 2 07:59:44 EST 2011


Hi Stephen,

On Mon, Nov 28, 2011 at 10:33 AM, Stephen Warren <swarren at nvidia.com> wrote:
> On 11/23/2011 08:54 PM, Simon Glass wrote:
>> This fixes three trivial issues in fdtdec.c:
>> 1. fdtdec_get_is_enabled() doesn't really need a default value
>> 2. The fdt must be word-aligned, since otherwise it will fail on ARM
>> 3. The compat_names[] array is missing its first element
>
>> diff --git a/lib/fdtdec.c b/lib/fdtdec.c
> ...
>>  #define COMPAT(id, name) name
>>  static const char * const compat_names[COMPAT_COUNT] = {
>> +     COMPAT(UNKNOWN, "<none>"),
>>  };
>
> Could you educate me on why that change is necessary? Maybe explain this
> in the commit description?

Yes I will update the description. The first element of the array is
supposed to be an invalid entry (see enum fdt_compat_id).

>
>> -int fdtdec_get_is_enabled(const void *blob, int node, int default_val)
>> +int fdtdec_get_is_enabled(const void *blob, int node)
>>  {
>>       const char *cell;
>>
>>       cell = fdt_getprop(blob, node, "status", NULL);
>>       if (cell)
>>               return 0 == strcmp(cell, "ok");
>> -     return default_val;
>> +     return 1;
>>  }
>
> Not that this patch changes this, but isn't "okay" also a legal
> "enabled" value, and perhaps even the recommended value? See
> http://lists.ozlabs.org/pipermail/devicetree-discuss/2011-July/006389.html.

Yes, I will change this, thanks.

Regards,
Simon

>
> --
> nvpublic
>


More information about the devicetree-discuss mailing list