aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2023-12-23 02:17:33 +0100
committerTom Rini <trini@konsulko.com>2024-01-16 17:05:29 -0500
commitddcfb9ede8da45ebbdb1c4facf07b0f0b735373f (patch)
tree28b5b3b326d93637989b76c9c0408b8595af1bfc
parent1c5aab803c0b0f07be1d3b0029f4031463497acf (diff)
downloadu-boot-ddcfb9ede8da45ebbdb1c4facf07b0f0b735373f.zip
u-boot-ddcfb9ede8da45ebbdb1c4facf07b0f0b735373f.tar.gz
u-boot-ddcfb9ede8da45ebbdb1c4facf07b0f0b735373f.tar.bz2
lib: smbios: remove redundant next_header()
next_header() and get_next_header() only differ in how the const attribute is used. One function taking a const parameter and returning a non-const is good enough. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
-rw-r--r--lib/smbios-parser.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/lib/smbios-parser.c b/lib/smbios-parser.c
index e1180efa..ac9a367 100644
--- a/lib/smbios-parser.c
+++ b/lib/smbios-parser.c
@@ -39,14 +39,7 @@ static u8 *find_next_header(u8 *pos)
return pos;
}
-static struct smbios_header *get_next_header(struct smbios_header *curr)
-{
- u8 *pos = ((u8 *)curr) + curr->length;
-
- return (struct smbios_header *)find_next_header(pos);
-}
-
-static const struct smbios_header *next_header(const struct smbios_header *curr)
+static struct smbios_header *get_next_header(const struct smbios_header *curr)
{
u8 *pos = ((u8 *)curr) + curr->length;
@@ -62,7 +55,7 @@ const struct smbios_header *smbios_header(const struct smbios_entry *entry, int
if (header->type == type)
return header;
- header = next_header(header);
+ header = get_next_header(header);
}
return NULL;