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>
This commit is contained in:
Elyes HAOUAS 2021-12-31 18:46:13 +01:00 committed by Martin L Roth
parent c31db09a92
commit 93a195c80f
10 changed files with 8 additions and 16 deletions

View File

@ -4,9 +4,9 @@
#include <bootmem.h> #include <bootmem.h>
#include <cbmem.h> #include <cbmem.h>
#include <device/resource.h> #include <device/resource.h>
#include <stdlib.h>
#include <symbols.h> #include <symbols.h>
#include <assert.h> #include <assert.h>
#include <types.h>
static int initialized; static int initialized;
static int table_written; static int table_written;

View File

@ -15,7 +15,6 @@
#include <drivers/tpm/tpm_ppi.h> #include <drivers/tpm/tpm_ppi.h>
#include <fmap.h> #include <fmap.h>
#include <fw_config.h> #include <fw_config.h>
#include <stdlib.h>
#include <cbfs.h> #include <cbfs.h>
#include <cbmem.h> #include <cbmem.h>
#include <bootmem.h> #include <bootmem.h>
@ -23,6 +22,7 @@
#include <inttypes.h> #include <inttypes.h>
#include <spi_flash.h> #include <spi_flash.h>
#include <smmstore.h> #include <smmstore.h>
#include <types.h>
#if CONFIG(USE_OPTION_TABLE) #if CONFIG(USE_OPTION_TABLE)
#include <option_table.h> #include <option_table.h>

View File

@ -5,15 +5,14 @@
#include <console/console.h> #include <console/console.h>
#include <ctype.h> #include <ctype.h>
#include <endian.h> #include <endian.h>
#include <stdint.h>
#include <bootmem.h> #include <bootmem.h>
#include <stdlib.h>
#include <string.h> #include <string.h>
#include <program_loading.h> #include <program_loading.h>
#include <memrange.h> #include <memrange.h>
#include <fit.h> #include <fit.h>
#include <boardid.h> #include <boardid.h>
#include <commonlib/stdlib.h> #include <commonlib/stdlib.h>
#include <types.h>
static struct list_node image_nodes; static struct list_node image_nodes;
static struct list_node config_nodes; static struct list_node config_nodes;

View File

@ -19,7 +19,6 @@
#include <device/device.h> #include <device/device.h>
#include <device/pci.h> #include <device/pci.h>
#include <program_loading.h> #include <program_loading.h>
#include <stdlib.h>
#include <thread.h> #include <thread.h>
#include <timer.h> #include <timer.h>
#include <timestamp.h> #include <timestamp.h>

View File

@ -4,7 +4,6 @@
#include <cbmem.h> #include <cbmem.h>
#include <console/console.h> #include <console/console.h>
#include <imd.h> #include <imd.h>
#include <stdlib.h>
#include <string.h> #include <string.h>
#include <types.h> #include <types.h>
#include <imd_private.h> #include <imd_private.h>

View File

@ -7,7 +7,7 @@
#include <cbmem.h> #include <cbmem.h>
#include <imd.h> #include <imd.h>
#include <lib.h> #include <lib.h>
#include <stdlib.h> #include <types.h>
/* The program loader passes on cbmem_top and the program entry point /* 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. */ has to fill in the _cbmem_top_ptr symbol based on the calling arguments. */

View File

@ -1,7 +1,5 @@
/* SPDX-License-Identifier: GPL-2.0-only */ /* SPDX-License-Identifier: GPL-2.0-only */
#include <stdlib.h>
#include <cbfs.h> #include <cbfs.h>
#include <cbmem.h> #include <cbmem.h>
#include <console/console.h> #include <console/console.h>

View File

@ -1,13 +1,13 @@
/* SPDX-License-Identifier: GPL-2.0-only */ /* SPDX-License-Identifier: GPL-2.0-only */
#include <assert.h> #include <assert.h>
#include <cbmem.h> #include <cbmem.h>
#include <cbfs.h> #include <cbfs.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h> #include <string.h>
#include <console/console.h> #include <console/console.h>
#include <program_loading.h> #include <program_loading.h>
#include <rmodule.h> #include <rmodule.h>
#include <types.h>
/* Change this define to get more verbose debugging for module loading. */ /* Change this define to get more verbose debugging for module loading. */
#define PK_ADJ_LEVEL BIOS_NEVER #define PK_ADJ_LEVEL BIOS_NEVER

View File

@ -3,8 +3,6 @@
#include <commonlib/bsd/compression.h> #include <commonlib/bsd/compression.h>
#include <commonlib/endian.h> #include <commonlib/endian.h>
#include <console/console.h> #include <console/console.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h> #include <string.h>
#include <symbols.h> #include <symbols.h>
#include <cbfs.h> #include <cbfs.h>
@ -13,6 +11,7 @@
#include <program_loading.h> #include <program_loading.h>
#include <timestamp.h> #include <timestamp.h>
#include <cbmem.h> #include <cbmem.h>
#include <types.h>
/* The type syntax for C is essentially unparsable. -- Rob Pike */ /* The type syntax for C is essentially unparsable. -- Rob Pike */
typedef int (*checker_t)(struct cbfs_payload_segment *cbfssegs, void *args); typedef int (*checker_t)(struct cbfs_payload_segment *cbfssegs, void *args);

View File

@ -1,14 +1,12 @@
/* SPDX-License-Identifier: GPL-2.0-only */ /* SPDX-License-Identifier: GPL-2.0-only */
#include <assert.h> #include <assert.h>
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
#include <bootstate.h> #include <bootstate.h>
#include <console/console.h> #include <console/console.h>
#include <smp/node.h> #include <smp/node.h>
#include <thread.h> #include <thread.h>
#include <timer.h> #include <timer.h>
#include <types.h>
static u8 thread_stacks[CONFIG_STACK_SIZE * CONFIG_NUM_THREADS] __aligned(sizeof(uint64_t)); static u8 thread_stacks[CONFIG_STACK_SIZE * CONFIG_NUM_THREADS] __aligned(sizeof(uint64_t));
static bool initialized; static bool initialized;