diff options
author | Elyes HAOUAS <ehaouas@noos.fr> | 2021-12-31 18:46:13 +0100 |
---|---|---|
committer | Martin L Roth <martinroth@google.com> | 2022-04-24 17:43:57 +0000 |
commit | 93a195c80f92d1c7b010953de6cc9836cbbb5a4f (patch) | |
tree | 1b2754be77ee9968bb5b432532da5a9e9e4ab0b0 /src/lib | |
parent | c31db09a927e8502fa54aabf870e1703ead75959 (diff) |
lib: Remove unused <stdlib.h> and use <types.h> when appropriate
Unused <stdlib.h> found using:
diff <(git grep -l '#include <stdlib.h>' -- src/) <(git grep -l 'memalign(\|malloc(\|calloc(\|free(' -- src/)
Change-Id: I5ad171679cbfa67d522bd1105fb58e0f84b9cb89
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60621
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin L Roth <martinroth@google.com>
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/bootmem.c | 2 | ||||
-rw-r--r-- | src/lib/coreboot_table.c | 2 | ||||
-rw-r--r-- | src/lib/fit.c | 3 | ||||
-rw-r--r-- | src/lib/hardwaremain.c | 1 | ||||
-rw-r--r-- | src/lib/imd.c | 1 | ||||
-rw-r--r-- | src/lib/imd_cbmem.c | 2 | ||||
-rw-r--r-- | src/lib/prog_loaders.c | 2 | ||||
-rw-r--r-- | src/lib/rmodule.c | 4 | ||||
-rw-r--r-- | src/lib/selfboot.c | 3 | ||||
-rw-r--r-- | 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 <bootmem.h> #include <cbmem.h> #include <device/resource.h> -#include <stdlib.h> #include <symbols.h> #include <assert.h> +#include <types.h> 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 <drivers/tpm/tpm_ppi.h> #include <fmap.h> #include <fw_config.h> -#include <stdlib.h> #include <cbfs.h> #include <cbmem.h> #include <bootmem.h> @@ -23,6 +22,7 @@ #include <inttypes.h> #include <spi_flash.h> #include <smmstore.h> +#include <types.h> #if CONFIG(USE_OPTION_TABLE) #include <option_table.h> 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 <console/console.h> #include <ctype.h> #include <endian.h> -#include <stdint.h> #include <bootmem.h> -#include <stdlib.h> #include <string.h> #include <program_loading.h> #include <memrange.h> #include <fit.h> #include <boardid.h> #include <commonlib/stdlib.h> +#include <types.h> 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 <device/device.h> #include <device/pci.h> #include <program_loading.h> -#include <stdlib.h> #include <thread.h> #include <timer.h> #include <timestamp.h> 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 <cbmem.h> #include <console/console.h> #include <imd.h> -#include <stdlib.h> #include <string.h> #include <types.h> #include <imd_private.h> 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 <cbmem.h> #include <imd.h> #include <lib.h> -#include <stdlib.h> +#include <types.h> /* 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 <stdlib.h> #include <cbfs.h> #include <cbmem.h> #include <console/console.h> 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 <assert.h> #include <cbmem.h> #include <cbfs.h> -#include <stdint.h> -#include <stdlib.h> #include <string.h> #include <console/console.h> #include <program_loading.h> #include <rmodule.h> +#include <types.h> /* 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 <commonlib/bsd/compression.h> #include <commonlib/endian.h> #include <console/console.h> -#include <stdint.h> -#include <stdlib.h> #include <string.h> #include <symbols.h> #include <cbfs.h> @@ -13,6 +11,7 @@ #include <program_loading.h> #include <timestamp.h> #include <cbmem.h> +#include <types.h> /* 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 <assert.h> -#include <stddef.h> -#include <stdint.h> -#include <stdlib.h> #include <bootstate.h> #include <console/console.h> #include <smp/node.h> #include <thread.h> #include <timer.h> +#include <types.h> static u8 thread_stacks[CONFIG_STACK_SIZE * CONFIG_NUM_THREADS] __aligned(sizeof(uint64_t)); static bool initialized; |