[U-Boot] [PATCH 6/8] dm: core: look up drivers more efficiently

Masahiro Yamada yamada.m at jp.panasonic.com
Mon Nov 17 12:49:29 CET 2014


Hi Simon,


On Mon, 17 Nov 2014 09:22:19 +0000
Simon Glass <sjg at chromium.org> wrote:
> > --- a/drivers/core/device.c
> > +++ b/drivers/core/device.c
> > @@ -157,11 +157,9 @@ int device_bind_by_name(struct udevice *parent, bool pre_reloc_only,
> >  {
> >         struct driver *drv;
> >
> > -       drv = lists_driver_lookup_name(info->name);
> > +       drv = __lists_driver_lookup_name(info->name, pre_reloc_only);
> 
> This patch looks good, except that I would prefer
> lists_driver_lookup_name_prereloc() to __lists_driver_lookup_name().
> The __ seems like an internal compiler name to me. So can you rename
> it?

Indeed. I think __ should be used carefully especially when it comes to
host programs, but I think we can play it by ear in standalone binaries
such as the kernel and U-boot code.

I often see "__" prefixes in Linux and in my understanding,
__foo() is a "use it carefully" version or locally used interface of foo()
(for example, when the resources are not protected by spinlocks, etc.).
So, I often use it when I cannot invent a good func name.

Hmm, lists_driver_lookup_name_prereloc() is already too long
and __prereloc is a bit misleading because it is used both before and after relocation,
isn't it?


Best Regards
Masahiro Yamada



More information about the U-Boot mailing list