[PATCH 1/3] efi_loader: Add guidcpy function

Sughosh Ganu sughosh.ganu at linaro.org
Wed Dec 25 06:23:16 CET 2019


On Tue, 24 Dec 2019 at 22:42, Heinrich Schuchardt <xypron.glpk at gmx.de>
wrote:

> On 12/24/19 4:54 PM, Sughosh Ganu wrote:
> > Add guidcpy function to copy the source guid to the destination
> > guid.
> >
> > Signed-off-by: Sughosh Ganu <sughosh.ganu at linaro.org>
> > ---
> >   include/efi_loader.h | 5 +++++
> >   1 file changed, 5 insertions(+)
> >
> > diff --git a/include/efi_loader.h b/include/efi_loader.h
> > index 16a1b25..bec7873 100644
> > --- a/include/efi_loader.h
> > +++ b/include/efi_loader.h
> > @@ -17,6 +17,11 @@ static inline int guidcmp(const void *g1, const void
> *g2)
> >       return memcmp(g1, g2, sizeof(efi_guid_t));
> >   }
> >
> > +static inline void *guidcpy(efi_guid_t *dst, const efi_guid_t *src)
> > +{
> > +     return memcpy(dst, src, sizeof(*dst));
>
> If we introduce this function, here are other places to use it:
>
> lib/efi_loader/efi_boottime.c:1404:
> memcpy(&item->protocol, protocol, sizeof(efi_guid_t));
> lib/efi_loader/efi_boottime.c:1635:
> memcpy(&systab.tables[i].guid, guid, sizeof(*guid));
>

Ok. Will make changes to use guidcpy for these two instances as well in V2.

-sughosh


More information about the U-Boot mailing list