]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
lib: smbios: remove redundant next_header()
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Sat, 23 Dec 2023 01:17:33 +0000 (02:17 +0100)
committerTom Rini <trini@konsulko.com>
Tue, 16 Jan 2024 22:05:29 +0000 (17:05 -0500)
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>
lib/smbios-parser.c

index e1180efae18e4cb8bc74e87559fea0cfe07bff35..ac9a367a8786768c9404bab9dc5003ea10a2d38f 100644 (file)
@@ -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;