[PATCH v3 08/14] bloblist: Checksum the entire bloblist
Raymond Mao
raymond.mao at linaro.org
Wed Dec 27 16:14:50 CET 2023
Hi Ilias,
On Wed, 27 Dec 2023 at 04:57, Ilias Apalodimas <ilias.apalodimas at linaro.org>
wrote:
> Hi Raymond,
>
> On Mon, 18 Dec 2023 at 20:20, Raymond Mao <raymond.mao at linaro.org> wrote:
> >
> > From: Simon Glass <sjg at chromium.org>
> >
> > Spec v0.9 specifies that the entire bloblist area is checksummed,
> > including unused portions. Update the code to follow this.
> >
> > 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>
> > Reviewed-by: Simon Glass <sjg at chromium.org>
> > ---
> > common/bloblist.c | 9 +--------
> > test/bloblist.c | 10 ++++++++--
> > 2 files changed, 9 insertions(+), 10 deletions(-)
> >
> > diff --git a/common/bloblist.c b/common/bloblist.c
> > index 32692d8319..705d9c6ae9 100644
> > --- a/common/bloblist.c
> > +++ b/common/bloblist.c
> > @@ -319,17 +319,10 @@ int bloblist_resize(uint tag, int new_size)
> >
> > static u32 bloblist_calc_chksum(struct bloblist_hdr *hdr)
> > {
> > - struct bloblist_rec *rec;
> > u8 chksum;
> >
> > - chksum = table_compute_checksum(hdr, hdr->hdr_size);
> > + chksum = table_compute_checksum(hdr, hdr->alloced);
> > chksum += hdr->chksum;
> > - foreach_rec(rec, hdr) {
> > - chksum -= table_compute_checksum((void *)rec,
> > - rec_hdr_size(rec));
> > - chksum -= table_compute_checksum((void *)rec +
> > - rec_hdr_size(rec),
> rec->size);
> > - }
>
> Why do we need patch #7 if it gets removed immediately after?
> Can't we just squash those two with a proper commit message, since the
> spec requires checksumming the entire list?
>
> Yes. I think #7 and #8 can be squashed into one patch.
Will do this in V4.
Regards,
Raymond
More information about the U-Boot
mailing list