Skip to content

Commit

Permalink
smbios: Make some smbios_build_tables() arguments optional
Browse files Browse the repository at this point in the history
Make max_structure_size and number_of_structures optional,
as we don't have those fields in SMBIOS 3.0 entry points.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
  • Loading branch information
ehabkost authored and KevinOConnor committed Dec 18, 2021
1 parent 1daafc8 commit 6290dce
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/fw/biostables.c
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,9 @@ smbios_new_type_0(void *start,
/*
* Build tables using qtables as input, adding additional type 0
* table if necessary.
*
* @address and @length can't be NULL. @max_structure_size and
* @number_of_structures are optional and can be NULL.
*/
static int
smbios_build_tables(struct romfile_s *f_tables,
Expand Down Expand Up @@ -497,9 +500,10 @@ smbios_build_tables(struct romfile_s *f_tables,
need_t0 = 0;
} else {
*length += t0_len;
if (t0_len > *max_structure_size)
if (max_structure_size && t0_len > *max_structure_size)
*max_structure_size = t0_len;
(*number_of_structures)++;
if (number_of_structures)
(*number_of_structures)++;
}
}

Expand Down

0 comments on commit 6290dce

Please sign in to comment.