src: Use 'include <string.h>' when appropriate
Drop 'include <string.h>' when it is not used and
add it when it is missing.
Also extra lines removed, or added just before local includes.
Change-Id: Iccac4dbaa2dd4144fc347af36ecfc9747da3de20
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/31966
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
diff --git a/src/soc/amd/common/block/pci/amd_pci_util.c b/src/soc/amd/common/block/pci/amd_pci_util.c
index d06a8df..7a40d26 100644
--- a/src/soc/amd/common/block/pci/amd_pci_util.c
+++ b/src/soc/amd/common/block/pci/amd_pci_util.c
@@ -18,7 +18,6 @@
#include <device/pci.h>
#include <arch/io.h>
#include <device/pci_ops.h>
-#include <string.h>
#include <amdblocks/amd_pci_util.h>
#include <pc80/i8259.h>
#include <soc/amd_pci_int_defs.h>
diff --git a/src/soc/amd/common/block/pi/agesawrapper.c b/src/soc/amd/common/block/pi/agesawrapper.c
index fc69b46..485dfd7 100644
--- a/src/soc/amd/common/block/pi/agesawrapper.c
+++ b/src/soc/amd/common/block/pi/agesawrapper.c
@@ -17,7 +17,6 @@
#include <arch/acpi.h>
#include <cbmem.h>
#include <delay.h>
-#include <string.h>
#include <timestamp.h>
#include <amdblocks/s3_resume.h>
#include <amdblocks/agesawrapper.h>
diff --git a/src/soc/amd/common/block/pi/amd_late_init.c b/src/soc/amd/common/block/pi/amd_late_init.c
index 68cf3a1..fdecf00 100644
--- a/src/soc/amd/common/block/pi/amd_late_init.c
+++ b/src/soc/amd/common/block/pi/amd_late_init.c
@@ -23,6 +23,7 @@
#include <dimm_info_util.h>
#include <memory_info.h>
#include <lib.h>
+#include <string.h>
#include <amdblocks/agesawrapper.h>
#include <amdblocks/agesawrapper_call.h>
diff --git a/src/soc/amd/stoneyridge/spi.c b/src/soc/amd/stoneyridge/spi.c
index e6b1a36..c682d98 100644
--- a/src/soc/amd/stoneyridge/spi.c
+++ b/src/soc/amd/stoneyridge/spi.c
@@ -15,7 +15,6 @@
#include <stdint.h>
#include <stdlib.h>
-#include <string.h>
#include <device/mmio.h>
#include <lib.h>
#include <timer.h>
diff --git a/src/soc/intel/apollolake/romstage.c b/src/soc/intel/apollolake/romstage.c
index bef7052..47fbc0d 100644
--- a/src/soc/intel/apollolake/romstage.c
+++ b/src/soc/intel/apollolake/romstage.c
@@ -48,7 +48,6 @@
#include <soc/romstage.h>
#include <soc/systemagent.h>
#include <spi_flash.h>
-#include <string.h>
#include <timer.h>
#include <timestamp.h>
#include "chip.h"
diff --git a/src/soc/intel/apollolake/uart.c b/src/soc/intel/apollolake/uart.c
index 66a1a1a..a85ad1f 100644
--- a/src/soc/intel/apollolake/uart.c
+++ b/src/soc/intel/apollolake/uart.c
@@ -24,7 +24,6 @@
#include <intelblocks/uart.h>
#include <soc/gpio.h>
#include <soc/pci_devs.h>
-#include <string.h>
/* UART pad configuration. Support RXD and TXD for now. */
const struct uart_gpio_pad_config uart_gpio_pads[] = {
diff --git a/src/soc/intel/baytrail/refcode.c b/src/soc/intel/baytrail/refcode.c
index a5946bc..24469ea 100644
--- a/src/soc/intel/baytrail/refcode.c
+++ b/src/soc/intel/baytrail/refcode.c
@@ -13,7 +13,6 @@
* GNU General Public License for more details.
*/
-#include <string.h>
#include <arch/acpi.h>
#include <cbmem.h>
#include <console/console.h>
diff --git a/src/soc/intel/baytrail/smm.c b/src/soc/intel/baytrail/smm.c
index ec0aa85..42bc518f 100644
--- a/src/soc/intel/baytrail/smm.c
+++ b/src/soc/intel/baytrail/smm.c
@@ -20,8 +20,6 @@
#include <arch/io.h>
#include <device/mmio.h>
#include <cpu/x86/smm.h>
-#include <string.h>
-
#include <soc/iomap.h>
#include <soc/pmc.h>
#include <soc/smm.h>
diff --git a/src/soc/intel/baytrail/southcluster.c b/src/soc/intel/baytrail/southcluster.c
index 7b01cfa..0289e8b 100644
--- a/src/soc/intel/baytrail/southcluster.c
+++ b/src/soc/intel/baytrail/southcluster.c
@@ -30,6 +30,7 @@
#include <device/pci_ids.h>
#include <pc80/mc146818rtc.h>
#include <drivers/uart/uart8250reg.h>
+#include <string.h>
#include <soc/iomap.h>
#include <soc/irq.h>
diff --git a/src/soc/intel/baytrail/spi.c b/src/soc/intel/baytrail/spi.c
index 1faf651..d5b962f 100644
--- a/src/soc/intel/baytrail/spi.c
+++ b/src/soc/intel/baytrail/spi.c
@@ -13,9 +13,9 @@
*/
/* This file is derived from the flashrom project. */
+
#include <stdint.h>
#include <stdlib.h>
-#include <string.h>
#include <bootstate.h>
#include <delay.h>
#include <device/mmio.h>
diff --git a/src/soc/intel/braswell/ramstage.c b/src/soc/intel/braswell/ramstage.c
index b8362cd..d6a1cda 100644
--- a/src/soc/intel/braswell/ramstage.c
+++ b/src/soc/intel/braswell/ramstage.c
@@ -38,6 +38,7 @@
#include <soc/intel/common/acpi.h>
#include <boardid.h>
#include <stdlib.h>
+#include <string.h>
#define SHOW_PATTRS 1
diff --git a/src/soc/intel/braswell/smm.c b/src/soc/intel/braswell/smm.c
index 6f54d78..fe681c9 100644
--- a/src/soc/intel/braswell/smm.c
+++ b/src/soc/intel/braswell/smm.c
@@ -24,7 +24,6 @@
#include <soc/iomap.h>
#include <soc/pm.h>
#include <soc/smm.h>
-#include <string.h>
/* Save settings which will be committed in SMI functions. */
static uint32_t smm_save_params[SMM_SAVE_PARAM_COUNT];
diff --git a/src/soc/intel/braswell/spi.c b/src/soc/intel/braswell/spi.c
index c87232dd9..b968283 100644
--- a/src/soc/intel/braswell/spi.c
+++ b/src/soc/intel/braswell/spi.c
@@ -14,6 +14,7 @@
*/
/* This file is derived from the flashrom project. */
+
#include <device/mmio.h>
#include <device/pci_ops.h>
#include <bootstate.h>
@@ -28,7 +29,6 @@
#include <spi-generic.h>
#include <stdint.h>
#include <stdlib.h>
-#include <string.h>
typedef struct spi_slave ich_spi_slave;
diff --git a/src/soc/intel/broadwell/cpu.c b/src/soc/intel/broadwell/cpu.c
index d274be8..5592538 100644
--- a/src/soc/intel/broadwell/cpu.c
+++ b/src/soc/intel/broadwell/cpu.c
@@ -17,7 +17,6 @@
#include <console/console.h>
#include <device/device.h>
#include <device/pci.h>
-#include <string.h>
#include <arch/cpu.h>
#include <cpu/cpu.h>
#include <cpu/x86/mtrr.h>
diff --git a/src/soc/intel/broadwell/gpio.c b/src/soc/intel/broadwell/gpio.c
index 50f6a29..81ad9d4 100644
--- a/src/soc/intel/broadwell/gpio.c
+++ b/src/soc/intel/broadwell/gpio.c
@@ -14,7 +14,6 @@
*/
#include <stdint.h>
-#include <string.h>
#include <arch/io.h>
#include <device/device.h>
#include <device/pci.h>
diff --git a/src/soc/intel/broadwell/smi.c b/src/soc/intel/broadwell/smi.c
index f87b8a2..9aab0d1 100644
--- a/src/soc/intel/broadwell/smi.c
+++ b/src/soc/intel/broadwell/smi.c
@@ -20,7 +20,6 @@
#include <arch/io.h>
#include <cpu/x86/cache.h>
#include <cpu/x86/smm.h>
-#include <string.h>
#include <soc/iomap.h>
#include <soc/pch.h>
#include <soc/pm.h>
diff --git a/src/soc/intel/broadwell/spi.c b/src/soc/intel/broadwell/spi.c
index d812757..01d2830 100644
--- a/src/soc/intel/broadwell/spi.c
+++ b/src/soc/intel/broadwell/spi.c
@@ -14,7 +14,6 @@
/* This file is derived from the flashrom project. */
#include <stdint.h>
#include <stdlib.h>
-#include <string.h>
#include <bootstate.h>
#include <commonlib/helpers.h>
#include <delay.h>
diff --git a/src/soc/intel/broadwell/systemagent.c b/src/soc/intel/broadwell/systemagent.c
index aef1d1c..c6444b1 100644
--- a/src/soc/intel/broadwell/systemagent.c
+++ b/src/soc/intel/broadwell/systemagent.c
@@ -23,7 +23,6 @@
#include <device/pci.h>
#include <device/pci_ids.h>
#include <stdlib.h>
-#include <string.h>
#include <vendorcode/google/chromeos/chromeos.h>
#include <soc/cpu.h>
#include <soc/iomap.h>
diff --git a/src/soc/intel/cannonlake/chip.c b/src/soc/intel/cannonlake/chip.c
index 993e7f3..d50c689 100644
--- a/src/soc/intel/cannonlake/chip.c
+++ b/src/soc/intel/cannonlake/chip.c
@@ -27,7 +27,6 @@
#include <soc/itss.h>
#include <soc/pci_devs.h>
#include <soc/ramstage.h>
-#include <string.h>
#if CONFIG(HAVE_ACPI_TABLES)
const char *soc_acpi_name(const struct device *dev)
diff --git a/src/soc/intel/cannonlake/uart.c b/src/soc/intel/cannonlake/uart.c
index d03d21e..421cafc 100644
--- a/src/soc/intel/cannonlake/uart.c
+++ b/src/soc/intel/cannonlake/uart.c
@@ -23,7 +23,6 @@
#include <soc/pch.h>
#include <soc/pci_devs.h>
#include <soc/pcr_ids.h>
-#include <string.h>
/* Serial IO UART controller legacy mode */
#define PCR_SERIAL_IO_GPPRVRW7 0x618
diff --git a/src/soc/intel/common/block/acpi/acpi.c b/src/soc/intel/common/block/acpi/acpi.c
index e311ae6..c872e51 100644
--- a/src/soc/intel/common/block/acpi/acpi.c
+++ b/src/soc/intel/common/block/acpi/acpi.c
@@ -13,6 +13,7 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
+
#include <arch/acpigen.h>
#include <arch/ioapic.h>
#include <arch/smp/mpspec.h>
@@ -30,6 +31,7 @@
#include <soc/iomap.h>
#include <soc/nvs.h>
#include <soc/pm.h>
+#include <string.h>
__attribute__((weak)) unsigned long acpi_fill_mcfg(unsigned long current)
{
diff --git a/src/soc/intel/common/block/fast_spi/fast_spi.c b/src/soc/intel/common/block/fast_spi/fast_spi.c
index 2e3b99e..455b13c 100644
--- a/src/soc/intel/common/block/fast_spi/fast_spi.c
+++ b/src/soc/intel/common/block/fast_spi/fast_spi.c
@@ -26,7 +26,6 @@
#include <spi_flash.h>
#include <spi-generic.h>
#include <stdlib.h>
-#include <string.h>
/*
* Get the FAST_SPIBAR.
diff --git a/src/soc/intel/common/block/uart/uart.c b/src/soc/intel/common/block/uart/uart.c
index 7f21372..b89bf6f 100644
--- a/src/soc/intel/common/block/uart/uart.c
+++ b/src/soc/intel/common/block/uart/uart.c
@@ -27,7 +27,6 @@
#include <soc/pci_devs.h>
#include <soc/iomap.h>
#include <soc/nvs.h>
-#include <string.h>
#define UART_PCI_ENABLE (PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER)
#define UART_CONSOLE_INVALID_INDEX 0xFF
diff --git a/src/soc/intel/common/mma.c b/src/soc/intel/common/mma.c
index 77f8c1e..1b3a82a 100644
--- a/src/soc/intel/common/mma.c
+++ b/src/soc/intel/common/mma.c
@@ -18,6 +18,7 @@
#include <cbmem.h>
#include <console/console.h>
#include <soc/intel/common/mma.h>
+#include <string.h>
#define MMA_TEST_METADATA_FILENAME "mma_test_metadata.bin"
#define MMA_TEST_NAME_TAG "MMA_TEST_NAME"
diff --git a/src/soc/intel/common/pch/lockdown/lockdown.c b/src/soc/intel/common/pch/lockdown/lockdown.c
index 6f79466..99d8a35 100644
--- a/src/soc/intel/common/pch/lockdown/lockdown.c
+++ b/src/soc/intel/common/pch/lockdown/lockdown.c
@@ -21,7 +21,6 @@
#include <soc/pci_devs.h>
#include <soc/pcr_ids.h>
#include <soc/soc_chip.h>
-#include <string.h>
#define PCR_DMI_GCS 0x274C
#define PCR_DMI_GCS_BILD (1 << 0)
diff --git a/src/soc/intel/denverton_ns/csme_ie_kt.c b/src/soc/intel/denverton_ns/csme_ie_kt.c
index 5f90185..5967840 100644
--- a/src/soc/intel/denverton_ns/csme_ie_kt.c
+++ b/src/soc/intel/denverton_ns/csme_ie_kt.c
@@ -16,7 +16,6 @@
#include <stdint.h>
#include <stdlib.h>
-#include <string.h>
#include <device/pci.h>
#include <device/pci_ids.h>
#include <console/console.h>
diff --git a/src/soc/intel/denverton_ns/include/soc/soc_util.h b/src/soc/intel/denverton_ns/include/soc/soc_util.h
index 91bd12e..c348948 100644
--- a/src/soc/intel/denverton_ns/include/soc/soc_util.h
+++ b/src/soc/intel/denverton_ns/include/soc/soc_util.h
@@ -19,6 +19,7 @@
#ifndef __ACPI__
#include <device/device.h>
+#include <string.h>
/* Silicon revisions */
typedef enum {
diff --git a/src/soc/intel/denverton_ns/smm.c b/src/soc/intel/denverton_ns/smm.c
index 9d3fa75..2df6994 100644
--- a/src/soc/intel/denverton_ns/smm.c
+++ b/src/soc/intel/denverton_ns/smm.c
@@ -21,7 +21,6 @@
#include <console/console.h>
#include <arch/io.h>
#include <cpu/x86/smm.h>
-#include <string.h>
#include <soc/iomap.h>
#include <soc/soc_util.h>
diff --git a/src/soc/intel/denverton_ns/soc_util.c b/src/soc/intel/denverton_ns/soc_util.c
index 1e44021..ba7ba0f 100644
--- a/src/soc/intel/denverton_ns/soc_util.c
+++ b/src/soc/intel/denverton_ns/soc_util.c
@@ -20,7 +20,7 @@
#include <device/pci.h>
#include <device/pci_def.h>
#include <device/device.h>
-
+#include <string.h>
#include <soc/iomap.h>
#include <soc/soc_util.h>
#include <soc/pmc.h>
diff --git a/src/soc/intel/denverton_ns/systemagent.c b/src/soc/intel/denverton_ns/systemagent.c
index e715469..cc1d696 100644
--- a/src/soc/intel/denverton_ns/systemagent.c
+++ b/src/soc/intel/denverton_ns/systemagent.c
@@ -24,7 +24,6 @@
#include <device/pci.h>
#include <device/pci_ids.h>
#include <stdlib.h>
-#include <string.h>
#include <timer.h>
#include <soc/iomap.h>
diff --git a/src/soc/intel/fsp_baytrail/smm.c b/src/soc/intel/fsp_baytrail/smm.c
index 651e7d1..94b0944 100644
--- a/src/soc/intel/fsp_baytrail/smm.c
+++ b/src/soc/intel/fsp_baytrail/smm.c
@@ -20,8 +20,6 @@
#include <arch/io.h>
#include <device/mmio.h>
#include <cpu/x86/smm.h>
-#include <string.h>
-
#include <soc/iomap.h>
#include <soc/pmc.h>
#include <soc/smm.h>
diff --git a/src/soc/intel/fsp_baytrail/spi.c b/src/soc/intel/fsp_baytrail/spi.c
index 573c1c4..979ee57 100644
--- a/src/soc/intel/fsp_baytrail/spi.c
+++ b/src/soc/intel/fsp_baytrail/spi.c
@@ -15,9 +15,9 @@
*/
/* This file is derived from the flashrom project. */
+
#include <stdint.h>
#include <stdlib.h>
-#include <string.h>
#include <commonlib/helpers.h>
#include <delay.h>
#include <device/mmio.h>
diff --git a/src/soc/intel/fsp_broadwell_de/chip.c b/src/soc/intel/fsp_broadwell_de/chip.c
index 348e1c0..6b14845 100644
--- a/src/soc/intel/fsp_broadwell_de/chip.c
+++ b/src/soc/intel/fsp_broadwell_de/chip.c
@@ -14,7 +14,6 @@
* GNU General Public License for more details.
*/
-#include <string.h>
#include <bootstate.h>
#include <console/console.h>
#include <device/device.h>
diff --git a/src/soc/intel/icelake/chip.c b/src/soc/intel/icelake/chip.c
index 0978ab3d..0e4388e 100644
--- a/src/soc/intel/icelake/chip.c
+++ b/src/soc/intel/icelake/chip.c
@@ -28,7 +28,6 @@
#include <soc/itss.h>
#include <soc/pci_devs.h>
#include <soc/ramstage.h>
-#include <string.h>
#if CONFIG(HAVE_ACPI_TABLES)
const char *soc_acpi_name(const struct device *dev)
diff --git a/src/soc/intel/icelake/romstage/power_state.c b/src/soc/intel/icelake/romstage/power_state.c
index cfeffbb..4077550 100644
--- a/src/soc/intel/icelake/romstage/power_state.c
+++ b/src/soc/intel/icelake/romstage/power_state.c
@@ -18,7 +18,6 @@
#include <device/device.h>
#include <intelblocks/pmclib.h>
#include <intelblocks/tco.h>
-#include <string.h>
#include <soc/pci_devs.h>
#include <soc/pm.h>
diff --git a/src/soc/intel/icelake/uart.c b/src/soc/intel/icelake/uart.c
index d03d21e..421cafc 100644
--- a/src/soc/intel/icelake/uart.c
+++ b/src/soc/intel/icelake/uart.c
@@ -23,7 +23,6 @@
#include <soc/pch.h>
#include <soc/pci_devs.h>
#include <soc/pcr_ids.h>
-#include <string.h>
/* Serial IO UART controller legacy mode */
#define PCR_SERIAL_IO_GPPRVRW7 0x618
diff --git a/src/soc/intel/quark/spi.c b/src/soc/intel/quark/spi.c
index 0822e7d..7ffa203 100644
--- a/src/soc/intel/quark/spi.c
+++ b/src/soc/intel/quark/spi.c
@@ -25,6 +25,7 @@
#include <soc/pci_devs.h>
#include <soc/QuarkNcSocId.h>
#include <soc/spi.h>
+#include <string.h>
struct spi_context spi_driver_context = {
NULL,
diff --git a/src/soc/intel/skylake/cpu.c b/src/soc/intel/skylake/cpu.c
index 0ff5a13..0343a23 100644
--- a/src/soc/intel/skylake/cpu.c
+++ b/src/soc/intel/skylake/cpu.c
@@ -21,7 +21,6 @@
#include <console/console.h>
#include <device/device.h>
#include <device/pci.h>
-#include <string.h>
#include <chip.h>
#include <cpu/x86/mtrr.h>
#include <cpu/x86/msr.h>
diff --git a/src/soc/intel/skylake/uart.c b/src/soc/intel/skylake/uart.c
index 53d408a..1b2a742 100644
--- a/src/soc/intel/skylake/uart.c
+++ b/src/soc/intel/skylake/uart.c
@@ -23,7 +23,6 @@
#include <soc/bootblock.h>
#include <soc/pci_devs.h>
#include <soc/pcr_ids.h>
-#include <string.h>
/* Serial IO UART controller legacy mode */
#define PCR_SERIAL_IO_GPPRVRW7 0x618
diff --git a/src/soc/mediatek/mt8173/ddp.c b/src/soc/mediatek/mt8173/ddp.c
index 9f2f3b9..09ea200 100644
--- a/src/soc/mediatek/mt8173/ddp.c
+++ b/src/soc/mediatek/mt8173/ddp.c
@@ -17,7 +17,6 @@
#include <delay.h>
#include <edid.h>
#include <stdlib.h>
-#include <string.h>
#include <stddef.h>
#include <soc/addressmap.h>
#include <soc/ddp.h>
diff --git a/src/soc/mediatek/mt8173/dramc_pi_basic_api.c b/src/soc/mediatek/mt8173/dramc_pi_basic_api.c
index 0a0bad4..6dda102 100644
--- a/src/soc/mediatek/mt8173/dramc_pi_basic_api.c
+++ b/src/soc/mediatek/mt8173/dramc_pi_basic_api.c
@@ -26,7 +26,6 @@
#include <soc/mt6391.h>
#include <soc/pll.h>
#include <soc/spm.h>
-#include <string.h>
#include <types.h>
struct mem_pll {
diff --git a/src/soc/mediatek/mt8173/emi.c b/src/soc/mediatek/mt8173/emi.c
index c1e5d11..68b178f 100644
--- a/src/soc/mediatek/mt8173/emi.c
+++ b/src/soc/mediatek/mt8173/emi.c
@@ -18,7 +18,6 @@
#include <boardid.h>
#include <console/console.h>
#include <delay.h>
-#include <string.h>
#include <soc/addressmap.h>
#include <soc/dramc_common.h>
#include <soc/dramc_register.h>
diff --git a/src/soc/nvidia/tegra124/sor.c b/src/soc/nvidia/tegra124/sor.c
index 457f918..9188f83 100644
--- a/src/soc/nvidia/tegra124/sor.c
+++ b/src/soc/nvidia/tegra124/sor.c
@@ -30,7 +30,6 @@
#include <soc/sor.h>
#include <stdint.h>
#include <stdlib.h>
-#include <string.h>
#include "chip.h"
diff --git a/src/soc/nvidia/tegra124/spi.c b/src/soc/nvidia/tegra124/spi.c
index 51fa10f..45159c2 100644
--- a/src/soc/nvidia/tegra124/spi.c
+++ b/src/soc/nvidia/tegra124/spi.c
@@ -28,11 +28,9 @@
#include <spi_flash.h>
#include <stdint.h>
#include <stdlib.h>
-#include <string.h>
#include <symbols.h>
#include <timer.h>
-
#if defined(CONFIG_DEBUG_SPI) && CONFIG_DEBUG_SPI
# define DEBUG_SPI(x,...) printk(BIOS_DEBUG, "TEGRA_SPI: " x)
#else
diff --git a/src/soc/nvidia/tegra210/arm_tf.c b/src/soc/nvidia/tegra210/arm_tf.c
index 3ffcb0e..bd34185 100644
--- a/src/soc/nvidia/tegra210/arm_tf.c
+++ b/src/soc/nvidia/tegra210/arm_tf.c
@@ -19,7 +19,6 @@
#include <soc/addressmap.h>
#include <soc/console_uart.h>
#include <stdlib.h>
-#include <string.h>
#include <symbols.h>
typedef struct bl31_plat_params {
diff --git a/src/soc/nvidia/tegra210/ccplex.c b/src/soc/nvidia/tegra210/ccplex.c
index ce46e5e..fbda37f 100644
--- a/src/soc/nvidia/tegra210/ccplex.c
+++ b/src/soc/nvidia/tegra210/ccplex.c
@@ -25,7 +25,6 @@
#include <soc/pmc.h>
#include <soc/power.h>
#include <soc/romstage.h>
-#include <string.h>
#include <timer.h>
#define PMC_REGS (void *)(uintptr_t)(TEGRA_PMC_BASE)
diff --git a/src/soc/nvidia/tegra210/soc.c b/src/soc/nvidia/tegra210/soc.c
index a9d6835..c013099 100644
--- a/src/soc/nvidia/tegra210/soc.c
+++ b/src/soc/nvidia/tegra210/soc.c
@@ -26,7 +26,6 @@
#include <soc/cpu.h>
#include <soc/mc.h>
#include <soc/nvidia/tegra/apbmisc.h>
-#include <string.h>
#include <timer.h>
#include <soc/sdram.h>
#include <soc/sdram_configs.h>
diff --git a/src/soc/nvidia/tegra210/sor.c b/src/soc/nvidia/tegra210/sor.c
index 045715f..3055b29 100644
--- a/src/soc/nvidia/tegra210/sor.c
+++ b/src/soc/nvidia/tegra210/sor.c
@@ -22,7 +22,6 @@
#include <delay.h>
#include <soc/addressmap.h>
#include <device/device.h>
-#include <string.h>
#include <boot/tables.h>
#include <soc/nvidia/tegra/dc.h>
#include <soc/nvidia/tegra/types.h>
diff --git a/src/soc/nvidia/tegra210/spi.c b/src/soc/nvidia/tegra210/spi.c
index 6330779..6542df1 100644
--- a/src/soc/nvidia/tegra210/spi.c
+++ b/src/soc/nvidia/tegra210/spi.c
@@ -28,7 +28,6 @@
#include <soc/spi.h>
#include <stdint.h>
#include <stdlib.h>
-#include <string.h>
#include <symbols.h>
#include <timer.h>
diff --git a/src/soc/qualcomm/ipq40xx/spi.c b/src/soc/qualcomm/ipq40xx/spi.c
index c84a3e5..109eda9 100644
--- a/src/soc/qualcomm/ipq40xx/spi.c
+++ b/src/soc/qualcomm/ipq40xx/spi.c
@@ -34,7 +34,6 @@
#include <soc/iomap.h>
#include <soc/spi.h>
#include <stdlib.h>
-#include <string.h>
static const struct blsp_spi spi_reg[] = {
/* BLSP0 registers for SPI interface */
diff --git a/src/soc/qualcomm/ipq806x/spi.c b/src/soc/qualcomm/ipq806x/spi.c
index cdd2a99..6577345 100644
--- a/src/soc/qualcomm/ipq806x/spi.c
+++ b/src/soc/qualcomm/ipq806x/spi.c
@@ -20,7 +20,6 @@
#include <soc/iomap.h>
#include <soc/spi.h>
#include <stdlib.h>
-#include <string.h>
#define SUCCESS 0
diff --git a/src/soc/rockchip/common/i2c.c b/src/soc/rockchip/common/i2c.c
index 3c66a58..e5f5a9a 100644
--- a/src/soc/rockchip/common/i2c.c
+++ b/src/soc/rockchip/common/i2c.c
@@ -24,7 +24,6 @@
#include <soc/i2c.h>
#include <soc/clock.h>
#include <stdlib.h>
-#include <string.h>
#define RETRY_COUNT 3
/* 100000us = 100ms */
diff --git a/src/soc/rockchip/common/vop.c b/src/soc/rockchip/common/vop.c
index ffd2bea..1ee861c 100644
--- a/src/soc/rockchip/common/vop.c
+++ b/src/soc/rockchip/common/vop.c
@@ -16,7 +16,6 @@
#include <device/mmio.h>
#include <delay.h>
#include <stdlib.h>
-#include <string.h>
#include <stddef.h>
#include <soc/addressmap.h>
#include <soc/clock.h>
diff --git a/src/soc/rockchip/rk3288/hdmi.c b/src/soc/rockchip/rk3288/hdmi.c
index aecdeef..425d302 100644
--- a/src/soc/rockchip/rk3288/hdmi.c
+++ b/src/soc/rockchip/rk3288/hdmi.c
@@ -27,7 +27,6 @@
#include <gpio.h>
#include <stdlib.h>
#include <stdint.h>
-#include <string.h>
#include <soc/addressmap.h>
#include <soc/hdmi.h>
#include <soc/grf.h>
diff --git a/src/soc/rockchip/rk3288/sdram.c b/src/soc/rockchip/rk3288/sdram.c
index b343bab..808ff963 100644
--- a/src/soc/rockchip/rk3288/sdram.c
+++ b/src/soc/rockchip/rk3288/sdram.c
@@ -21,7 +21,6 @@
#include <soc/grf.h>
#include <soc/soc.h>
#include <soc/pmu.h>
-#include <string.h>
#include <types.h>
struct rk3288_ddr_pctl_regs {
diff --git a/src/soc/rockchip/rk3288/soc.c b/src/soc/rockchip/rk3288/soc.c
index ad679e5..19ad0eb 100644
--- a/src/soc/rockchip/rk3288/soc.c
+++ b/src/soc/rockchip/rk3288/soc.c
@@ -24,7 +24,6 @@
#include <soc/sdram.h>
#include <stddef.h>
#include <stdlib.h>
-#include <string.h>
#include <symbols.h>
#include "chip.h"
diff --git a/src/soc/rockchip/rk3399/display.c b/src/soc/rockchip/rk3399/display.c
index 35e338d..e2e9f7d 100644
--- a/src/soc/rockchip/rk3399/display.c
+++ b/src/soc/rockchip/rk3399/display.c
@@ -23,7 +23,6 @@
#include <gpio.h>
#include <stdlib.h>
#include <stddef.h>
-#include <string.h>
#include <soc/addressmap.h>
#include <soc/clock.h>
#include <soc/display.h>
diff --git a/src/soc/rockchip/rk3399/sdram.c b/src/soc/rockchip/rk3399/sdram.c
index e01b3a6..0e8cda6 100644
--- a/src/soc/rockchip/rk3399/sdram.c
+++ b/src/soc/rockchip/rk3399/sdram.c
@@ -22,7 +22,6 @@
#include <soc/sdram.h>
#include <soc/grf.h>
#include <soc/soc.h>
-#include <string.h>
#include <timer.h>
#include <types.h>
diff --git a/src/soc/rockchip/rk3399/soc.c b/src/soc/rockchip/rk3399/soc.c
index ee8ac8a..3f3ff97 100644
--- a/src/soc/rockchip/rk3399/soc.c
+++ b/src/soc/rockchip/rk3399/soc.c
@@ -24,7 +24,6 @@
#include <soc/symbols.h>
#include <stddef.h>
#include <stdlib.h>
-#include <string.h>
#include <symbols.h>
void bootmem_platform_add_ranges(void)
diff --git a/src/soc/samsung/exynos5250/alternate_cbfs.c b/src/soc/samsung/exynos5250/alternate_cbfs.c
index 7d24294..9fef9ae 100644
--- a/src/soc/samsung/exynos5250/alternate_cbfs.c
+++ b/src/soc/samsung/exynos5250/alternate_cbfs.c
@@ -20,7 +20,6 @@
#include <soc/power.h>
#include <soc/spi.h>
#include <stdlib.h>
-#include <string.h>
#include <symbols.h>
/* This allows USB A-A firmware upload from a compatible host in four parts:
diff --git a/src/soc/samsung/exynos5250/fb.c b/src/soc/samsung/exynos5250/fb.c
index 40d23b6..64980a1 100644
--- a/src/soc/samsung/exynos5250/fb.c
+++ b/src/soc/samsung/exynos5250/fb.c
@@ -26,7 +26,6 @@
#include <soc/power.h>
#include <soc/sysreg.h>
#include <stdlib.h>
-#include <string.h>
#include <timer.h>
/*
diff --git a/src/soc/samsung/exynos5250/gpio.c b/src/soc/samsung/exynos5250/gpio.c
index 736f274..96cfef6 100644
--- a/src/soc/samsung/exynos5250/gpio.c
+++ b/src/soc/samsung/exynos5250/gpio.c
@@ -19,7 +19,6 @@
#include <delay.h>
#include <soc/cpu.h>
#include <soc/gpio.h>
-#include <string.h>
#define CON_MASK(x) (0xf << ((x) << 2))
#define CON_SFR(x, v) ((v) << ((x) << 2))
diff --git a/src/soc/samsung/exynos5420/alternate_cbfs.c b/src/soc/samsung/exynos5420/alternate_cbfs.c
index 4ef049e..a1e92a0 100644
--- a/src/soc/samsung/exynos5420/alternate_cbfs.c
+++ b/src/soc/samsung/exynos5420/alternate_cbfs.c
@@ -21,7 +21,6 @@
#include <soc/power.h>
#include <soc/spi.h>
#include <stdlib.h>
-#include <string.h>
#include <symbols.h>
/* This allows USB A-A firmware upload from a compatible host in four parts:
diff --git a/src/soc/samsung/exynos5420/dp_lowlevel.c b/src/soc/samsung/exynos5420/dp_lowlevel.c
index ebcb122..5381657 100644
--- a/src/soc/samsung/exynos5420/dp_lowlevel.c
+++ b/src/soc/samsung/exynos5420/dp_lowlevel.c
@@ -23,7 +23,6 @@
#include <soc/power.h>
#include <soc/sysreg.h>
#include <stdlib.h>
-#include <string.h>
#include <timer.h>
/* FIXME: I think the DP controller shouldn't be hardcoded here... */
diff --git a/src/soc/samsung/exynos5420/gpio.c b/src/soc/samsung/exynos5420/gpio.c
index 1df3ae4..1462c29 100644
--- a/src/soc/samsung/exynos5420/gpio.c
+++ b/src/soc/samsung/exynos5420/gpio.c
@@ -19,7 +19,6 @@
#include <delay.h>
#include <soc/cpu.h>
#include <soc/gpio.h>
-#include <string.h>
#define CON_MASK(x) (0xf << ((x) << 2))
#define CON_SFR(x, v) ((v) << ((x) << 2))