From 93a195c80f92d1c7b010953de6cc9836cbbb5a4f Mon Sep 17 00:00:00 2001 From: Elyes HAOUAS Date: Fri, 31 Dec 2021 18:46:13 +0100 Subject: [PATCH] lib: Remove unused and use when appropriate Unused found using: diff <(git grep -l '#include ' -- src/) <(git grep -l 'memalign(\|malloc(\|calloc(\|free(' -- src/) Change-Id: I5ad171679cbfa67d522bd1105fb58e0f84b9cb89 Signed-off-by: Elyes Haouas Reviewed-on: https://review.coreboot.org/c/coreboot/+/60621 Tested-by: build bot (Jenkins) Reviewed-by: Martin L Roth --- src/lib/bootmem.c | 2 +- src/lib/coreboot_table.c | 2 +- src/lib/fit.c | 3 +-- src/lib/hardwaremain.c | 1 - src/lib/imd.c | 1 - src/lib/imd_cbmem.c | 2 +- src/lib/prog_loaders.c | 2 -- src/lib/rmodule.c | 4 ++-- src/lib/selfboot.c | 3 +-- src/lib/thread.c | 4 +--- 10 files changed, 8 insertions(+), 16 deletions(-) diff --git a/src/lib/bootmem.c b/src/lib/bootmem.c index d4462d88b4..078f960932 100644 --- a/src/lib/bootmem.c +++ b/src/lib/bootmem.c @@ -4,9 +4,9 @@ #include #include #include -#include #include #include +#include static int initialized; static int table_written; diff --git a/src/lib/coreboot_table.c b/src/lib/coreboot_table.c index 698118c75a..ebaa3a52f5 100644 --- a/src/lib/coreboot_table.c +++ b/src/lib/coreboot_table.c @@ -15,7 +15,6 @@ #include #include #include -#include #include #include #include @@ -23,6 +22,7 @@ #include #include #include +#include #if CONFIG(USE_OPTION_TABLE) #include diff --git a/src/lib/fit.c b/src/lib/fit.c index 08fd0455b3..6b4067e6f1 100644 --- a/src/lib/fit.c +++ b/src/lib/fit.c @@ -5,15 +5,14 @@ #include #include #include -#include #include -#include #include #include #include #include #include #include +#include static struct list_node image_nodes; static struct list_node config_nodes; diff --git a/src/lib/hardwaremain.c b/src/lib/hardwaremain.c index b5ed6e0714..4a5b2f790c 100644 --- a/src/lib/hardwaremain.c +++ b/src/lib/hardwaremain.c @@ -19,7 +19,6 @@ #include #include #include -#include #include #include #include diff --git a/src/lib/imd.c b/src/lib/imd.c index ac19d76f52..5cba121df2 100644 --- a/src/lib/imd.c +++ b/src/lib/imd.c @@ -4,7 +4,6 @@ #include #include #include -#include #include #include #include diff --git a/src/lib/imd_cbmem.c b/src/lib/imd_cbmem.c index 4b7c4120b0..453b0c1340 100644 --- a/src/lib/imd_cbmem.c +++ b/src/lib/imd_cbmem.c @@ -7,7 +7,7 @@ #include #include #include -#include +#include /* The program loader passes on cbmem_top and the program entry point has to fill in the _cbmem_top_ptr symbol based on the calling arguments. */ diff --git a/src/lib/prog_loaders.c b/src/lib/prog_loaders.c index 0e175c6b70..18d54f50eb 100644 --- a/src/lib/prog_loaders.c +++ b/src/lib/prog_loaders.c @@ -1,7 +1,5 @@ /* SPDX-License-Identifier: GPL-2.0-only */ - -#include #include #include #include diff --git a/src/lib/rmodule.c b/src/lib/rmodule.c index 31bf14190f..bee71d88ee 100644 --- a/src/lib/rmodule.c +++ b/src/lib/rmodule.c @@ -1,13 +1,13 @@ /* SPDX-License-Identifier: GPL-2.0-only */ + #include #include #include -#include -#include #include #include #include #include +#include /* Change this define to get more verbose debugging for module loading. */ #define PK_ADJ_LEVEL BIOS_NEVER diff --git a/src/lib/selfboot.c b/src/lib/selfboot.c index 70ab7199dd..637ad13883 100644 --- a/src/lib/selfboot.c +++ b/src/lib/selfboot.c @@ -3,8 +3,6 @@ #include #include #include -#include -#include #include #include #include @@ -13,6 +11,7 @@ #include #include #include +#include /* The type syntax for C is essentially unparsable. -- Rob Pike */ typedef int (*checker_t)(struct cbfs_payload_segment *cbfssegs, void *args); diff --git a/src/lib/thread.c b/src/lib/thread.c index adfc298a71..dc83df0668 100644 --- a/src/lib/thread.c +++ b/src/lib/thread.c @@ -1,14 +1,12 @@ /* SPDX-License-Identifier: GPL-2.0-only */ #include -#include -#include -#include #include #include #include #include #include +#include static u8 thread_stacks[CONFIG_STACK_SIZE * CONFIG_NUM_THREADS] __aligned(sizeof(uint64_t)); static bool initialized;