diff mbox series

[v3,06/14] bloblist: Drop spare value from bloblist record

Message ID 20231218181901.337515-7-raymond.mao@linaro.org
State Superseded
Delegated to: Simon Glass
Headers show
Series Support Firmware Handoff spec via bloblist | expand

Commit Message

Raymond Mao Dec. 18, 2023, 6:18 p.m. UTC
From: Simon Glass <sjg@chromium.org>

Drop spare value from bloblist record header.

For now it is still present in the header, with an underscore, so that
tests continue to pass.

Signed-off-by: Simon Glass <sjg@chromium.org>
Co-developed-by: Raymond Mao <raymond.mao@linaro.org>
Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
---
Changes in v3
- Keep the spare value in the bloblist header to align to FW handoff spec up to commit 3592349.

 common/bloblist.c  | 1 -
 include/bloblist.h | 3 +--
 2 files changed, 1 insertion(+), 3 deletions(-)

Comments

Ilias Apalodimas Dec. 27, 2023, 9:42 a.m. UTC | #1
Hi Raymond,

On Mon, 18 Dec 2023 at 20:20, Raymond Mao <raymond.mao@linaro.org> wrote:
>
> From: Simon Glass <sjg@chromium.org>
>
> Drop spare value from bloblist record header.
>
> For now it is still present in the header, with an underscore, so that
> tests continue to pass.

I am not sure I understand the commit message. Doesn't the spec define
this as 'reserved' now?
On top of that, it's a better idea to follow the spec naming. It's
easier to map the spec -> code for new readers. So I would rename

tag -> tag_id
size -> data_size and
flags -> reserved.

Can we at least do the flags -> reserved in this patch?

[...]

Thanks
/Ilias
Raymond Mao Dec. 27, 2023, 3:32 p.m. UTC | #2
Hi Ilias,

On Wed, 27 Dec 2023 at 04:43, Ilias Apalodimas <ilias.apalodimas@linaro.org>
wrote:

> Hi Raymond,
>
> On Mon, 18 Dec 2023 at 20:20, Raymond Mao <raymond.mao@linaro.org> wrote:
> >
> > From: Simon Glass <sjg@chromium.org>
> >
> > Drop spare value from bloblist record header.
> >
> > For now it is still present in the header, with an underscore, so that
> > tests continue to pass.
>
> I am not sure I understand the commit message. Doesn't the spec define
> this as 'reserved' now?
> On top of that, it's a better idea to follow the spec naming. It's
> easier to map the spec -> code for new readers. So I would rename
>
> tag -> tag_id
> size -> data_size and
> flags -> reserved.
>
> Can we at least do the flags -> reserved in this patch?
>
> I will update the naming of members in v4.

Regards,
Raymond
Raymond Mao Dec. 27, 2023, 7:21 p.m. UTC | #3
Hi Ilias,

On Wed, 27 Dec 2023 at 04:43, Ilias Apalodimas <ilias.apalodimas@linaro.org>
wrote:

> Hi Raymond,
>
> On Mon, 18 Dec 2023 at 20:20, Raymond Mao <raymond.mao@linaro.org> wrote:
> >
> > From: Simon Glass <sjg@chromium.org>
> >
> > Drop spare value from bloblist record header.
> >
> > For now it is still present in the header, with an underscore, so that
> > tests continue to pass.
>
> I am not sure I understand the commit message. Doesn't the spec define
> this as 'reserved' now?
> On top of that, it's a better idea to follow the spec naming. It's
> easier to map the spec -> code for new readers. So I would rename
>
> tag -> tag_id
> size -> data_size and
> flags -> reserved.
>
> Can we at least do the flags -> reserved in this patch?
>
> The spec only defines a spare field for TL header (bloblist header) but
not for a TE header
(bloblist record header), so we just remove the spare field, no need to
update this patch
I think.

[...]

Regards,
Raymond
diff mbox series

Patch

diff --git a/common/bloblist.c b/common/bloblist.c
index 168993e0a7..88e2a0f5c0 100644
--- a/common/bloblist.c
+++ b/common/bloblist.c
@@ -165,7 +165,6 @@  static int bloblist_addrec(uint tag, int size, int align_log2,
 	rec->tag = tag;
 	rec->hdr_size = data_start - hdr->alloced;
 	rec->size = size;
-	rec->spare = 0;
 
 	/* Zero the record data */
 	memset((void *)rec + rec_hdr_size(rec), '\0', rec->size);
diff --git a/include/bloblist.h b/include/bloblist.h
index 7eff709ec8..68f97395b7 100644
--- a/include/bloblist.h
+++ b/include/bloblist.h
@@ -205,13 +205,12 @@  struct bloblist_hdr {
  *	record's data starts at this offset from the start of the record
  * @size: Size of record in bytes, excluding the header size. This does not
  *	need to be aligned (e.g. 3 is OK).
- * @spare: Spare space for other things
  */
 struct bloblist_rec {
 	u32 tag;
 	u32 hdr_size;
 	u32 size;
-	u32 spare;
+	u32 _spare;
 };
 
 /**