[U-Boot] A minor question on a Driver Model function

Simon Glass sjg at chromium.org
Sun Sep 14 20:28:52 CEST 2014


Hi Masahiro,

On 12 September 2014 05:25, Masahiro Yamada <yamada.m at jp.panasonic.com> wrote:
> Hi Simon,
>
>
> I have a qustion about lists_driver_lookup_name() function.
>
>
>
>         for (entry = drv; entry != drv + n_ents; entry++) {
>                 if (strncmp(name, entry->name, len))
>                         continue;
>
>                 /* Full match */
>                 if (len == strlen(entry->name))
>                         return entry;
>         }
>
>
>
>
> Why is this not like follows?
>
>
>
>
>         for (entry = drv; entry != drv + n_ents; entry++) {
>                 if (!strcmp(name, entry->name))
>                         return entry;
>         }

I think that code was there from the beginning. Marek might have
written it...the original series that I did as an RFC was here.

http://patchwork.ozlabs.org/patch/239255/

Might worth a patch.

>
>
>
> It seems equivalent to the former and simpler.
>
> Am I missing something?
>
>
>
> Best Regards
> Masahiro Yamada
>

Regards,
Simon


More information about the U-Boot mailing list