[PATCH v3 12/14] bloblist: Add alignment to bloblist_new()

Raymond Mao raymond.mao at linaro.org
Wed Dec 27 16:11:40 CET 2023


Hi Ilias,

On Wed, 27 Dec 2023 at 05:10, Ilias Apalodimas <ilias.apalodimas at linaro.org>
wrote:

> On Mon, 18 Dec 2023 at 20:20, Raymond Mao <raymond.mao at linaro.org> wrote:
> >
> > From: Simon Glass <sjg at chromium.org>
> >
> > Allow the alignment to be specified when creating a bloblist.
> >
> > Signed-off-by: Simon Glass <sjg at chromium.org>
> > Co-developed-by: Raymond Mao <raymond.mao at linaro.org>
> > Signed-off-by: Raymond Mao <raymond.mao at linaro.org>
> > ---
> > Changes in v3
> > - Keep the flag argument to align to FW handoff spec up to commit
> 3592349.
> >
> >  common/bloblist.c  |  5 +++--
> >  include/bloblist.h |  3 ++-
> >  test/bloblist.c    | 40 ++++++++++++++++++++++------------------
> >  3 files changed, 27 insertions(+), 21 deletions(-)
> >
> > diff --git a/common/bloblist.c b/common/bloblist.c
> > index 1c97d61e4a..6d079c58f7 100644
> > --- a/common/bloblist.c
> > +++ b/common/bloblist.c
> > @@ -349,7 +349,7 @@ static u32 bloblist_calc_chksum(struct bloblist_hdr
> *hdr)
> >         return chksum;
> >  }
> >
> > -int bloblist_new(ulong addr, uint size, uint flags)
> > +int bloblist_new(ulong addr, uint size, uint flags, uint align_log2)
> >  {
> >         struct bloblist_hdr *hdr;
> >
> > @@ -365,6 +365,7 @@ int bloblist_new(ulong addr, uint size, uint flags)
> >         hdr->magic = BLOBLIST_MAGIC;
> >         hdr->size = size;
> >         hdr->alloced = hdr->hdr_size;
> > +       hdr->align_log2 = align_log2 ?: BLOBLIST_BLOB_ALIGN_LOG2;
>
> nit, but can we write this as a full ternary operator in the next release.
>
> Yes, I agree. Will change this in V4.

Regards,
Raymond


More information about the U-Boot mailing list