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/northbridge/intel/e7505/northbridge.c b/src/northbridge/intel/e7505/northbridge.c
index 8c31f7e..e3d3faf 100644
--- a/src/northbridge/intel/e7505/northbridge.c
+++ b/src/northbridge/intel/e7505/northbridge.c
@@ -11,6 +11,7 @@
* GNU General Public License for more details.
*/
+#include <arch/acpi.h>
#include <console/console.h>
#include <device/pci_ops.h>
#include <stdint.h>
@@ -18,9 +19,8 @@
#include <device/pci.h>
#include <cpu/cpu.h>
#include <stdlib.h>
-#include <string.h>
+
#include "e7505.h"
-#include <arch/acpi.h>
unsigned long acpi_fill_mcfg(unsigned long current)
{
diff --git a/src/northbridge/intel/fsp_rangeley/acpi.c b/src/northbridge/intel/fsp_rangeley/acpi.c
index 901843d..0c52d52 100644
--- a/src/northbridge/intel/fsp_rangeley/acpi.c
+++ b/src/northbridge/intel/fsp_rangeley/acpi.c
@@ -17,12 +17,12 @@
*/
#include <types.h>
-#include <string.h>
#include <arch/acpi.h>
#include <device/device.h>
#include <device/pci.h>
#include <device/pci_ids.h>
#include <arch/acpigen.h>
+
#include "northbridge.h"
unsigned long acpi_fill_mcfg(unsigned long current)
diff --git a/src/northbridge/intel/fsp_rangeley/northbridge.c b/src/northbridge/intel/fsp_rangeley/northbridge.c
index cd900be..7663b26 100644
--- a/src/northbridge/intel/fsp_rangeley/northbridge.c
+++ b/src/northbridge/intel/fsp_rangeley/northbridge.c
@@ -25,13 +25,13 @@
#include <device/pci.h>
#include <device/pci_ids.h>
#include <stdlib.h>
-#include <string.h>
#include <cpu/cpu.h>
-#include "chip.h"
-#include "northbridge.h"
#include <drivers/intel/fsp1_0/fsp_util.h>
#include <cpu/x86/lapic.h>
+#include "chip.h"
+#include "northbridge.h"
+
static int bridge_revision_id = -1;
int bridge_silicon_revision(void)
diff --git a/src/northbridge/intel/fsp_rangeley/raminit.c b/src/northbridge/intel/fsp_rangeley/raminit.c
index 3294135..da9ed71 100644
--- a/src/northbridge/intel/fsp_rangeley/raminit.c
+++ b/src/northbridge/intel/fsp_rangeley/raminit.c
@@ -14,12 +14,12 @@
* GNU General Public License for more details.
*/
-#include <string.h>
#include <cbmem.h>
#include <device/pci_def.h>
-#include "northbridge.h"
#include <drivers/intel/fsp1_0/fsp_util.h>
+#include "northbridge.h"
+
static uintptr_t smm_region_start(void)
{
/*
diff --git a/src/northbridge/intel/gm45/acpi.c b/src/northbridge/intel/gm45/acpi.c
index 301743ce..decf712 100644
--- a/src/northbridge/intel/gm45/acpi.c
+++ b/src/northbridge/intel/gm45/acpi.c
@@ -15,13 +15,13 @@
*/
#include <types.h>
-#include <string.h>
#include <console/console.h>
#include <arch/acpi.h>
#include <arch/acpigen.h>
#include <device/device.h>
#include <device/pci.h>
#include <device/pci_ops.h>
+
#include "gm45.h"
unsigned long acpi_fill_mcfg(unsigned long current)
diff --git a/src/northbridge/intel/gm45/northbridge.c b/src/northbridge/intel/gm45/northbridge.c
index 40e4f61..f011cce 100644
--- a/src/northbridge/intel/gm45/northbridge.c
+++ b/src/northbridge/intel/gm45/northbridge.c
@@ -20,11 +20,11 @@
#include <device/device.h>
#include <device/pci.h>
#include <stdlib.h>
-#include <string.h>
#include <cpu/cpu.h>
#include <boot/tables.h>
#include <arch/acpi.h>
#include <cpu/intel/smm/gen1/smi.h>
+
#include "chip.h"
#include "gm45.h"
diff --git a/src/northbridge/intel/gm45/pcie.c b/src/northbridge/intel/gm45/pcie.c
index c470b81..4199274 100644
--- a/src/northbridge/intel/gm45/pcie.c
+++ b/src/northbridge/intel/gm45/pcie.c
@@ -16,7 +16,6 @@
#include <stdint.h>
#include <stddef.h>
-#include <string.h>
#include <device/pci_ops.h>
#include <device/pci_def.h>
#include <console/console.h>
diff --git a/src/northbridge/intel/gm45/pm.c b/src/northbridge/intel/gm45/pm.c
index a447a23..d96bcf4 100644
--- a/src/northbridge/intel/gm45/pm.c
+++ b/src/northbridge/intel/gm45/pm.c
@@ -16,7 +16,6 @@
#include <stdint.h>
#include <stddef.h>
-#include <string.h>
#include <device/pci_def.h>
#include <cpu/x86/msr.h>
#include <cpu/intel/speedstep.h>
diff --git a/src/northbridge/intel/gm45/romstage.c b/src/northbridge/intel/gm45/romstage.c
index 7335ac9..09439f2 100644
--- a/src/northbridge/intel/gm45/romstage.c
+++ b/src/northbridge/intel/gm45/romstage.c
@@ -27,6 +27,7 @@
#include <northbridge/intel/gm45/gm45.h>
#include <southbridge/intel/i82801ix/i82801ix.h>
#include <southbridge/intel/common/gpio.h>
+#include <string.h>
#define LPC_DEV PCI_DEV(0, 0x1f, 0)
#define MCH_DEV PCI_DEV(0, 0, 0)
diff --git a/src/northbridge/intel/gm45/thermal.c b/src/northbridge/intel/gm45/thermal.c
index 3ed75b3..1629a67 100644
--- a/src/northbridge/intel/gm45/thermal.c
+++ b/src/northbridge/intel/gm45/thermal.c
@@ -16,11 +16,10 @@
#include <stdint.h>
#include <stddef.h>
-#include <string.h>
#include <device/pci_def.h>
#include <spd.h>
-#include "delay.h"
+#include "delay.h"
#include "gm45.h"
void raminit_thermal(const sysinfo_t *sysinfo)
diff --git a/src/northbridge/intel/haswell/northbridge.c b/src/northbridge/intel/haswell/northbridge.c
index ad4563b..2b7afa8 100644
--- a/src/northbridge/intel/haswell/northbridge.c
+++ b/src/northbridge/intel/haswell/northbridge.c
@@ -26,9 +26,9 @@
#include <device/pci_ids.h>
#include <device/pci_ops.h>
#include <stdlib.h>
-#include <string.h>
#include <cpu/x86/smm.h>
#include <boot/tables.h>
+
#include "chip.h"
#include "haswell.h"
diff --git a/src/northbridge/intel/i440bx/northbridge.c b/src/northbridge/intel/i440bx/northbridge.c
index 2e4c3a1..ef6329c 100644
--- a/src/northbridge/intel/i440bx/northbridge.c
+++ b/src/northbridge/intel/i440bx/northbridge.c
@@ -18,7 +18,6 @@
#include <device/pci.h>
#include <device/pci_ids.h>
#include <stdlib.h>
-#include <string.h>
#include <cpu/cpu.h>
#include "northbridge.h"
#include "i440bx.h"
diff --git a/src/northbridge/intel/i945/acpi.c b/src/northbridge/intel/i945/acpi.c
index f817cdf..3a9f6a2 100644
--- a/src/northbridge/intel/i945/acpi.c
+++ b/src/northbridge/intel/i945/acpi.c
@@ -15,7 +15,6 @@
*/
#include <types.h>
-#include <string.h>
#include <arch/acpi.h>
#include <arch/acpigen.h>
#include <device/device.h>
diff --git a/src/northbridge/intel/i945/early_init.c b/src/northbridge/intel/i945/early_init.c
index e8cacf6..d3ed277 100644
--- a/src/northbridge/intel/i945/early_init.c
+++ b/src/northbridge/intel/i945/early_init.c
@@ -22,7 +22,6 @@
#include <cbmem.h>
#include <halt.h>
#include <romstage_handoff.h>
-#include <string.h>
#include "i945.h"
#include <pc80/mc146818rtc.h>
#include <southbridge/intel/common/gpio.h>
diff --git a/src/northbridge/intel/i945/northbridge.c b/src/northbridge/intel/i945/northbridge.c
index ce7d292..82392f4 100644
--- a/src/northbridge/intel/i945/northbridge.c
+++ b/src/northbridge/intel/i945/northbridge.c
@@ -21,7 +21,6 @@
#include <device/pci.h>
#include <device/pci_ids.h>
#include <stdlib.h>
-#include <string.h>
#include <cpu/cpu.h>
#include <arch/acpi.h>
#include <cpu/intel/smm/gen1/smi.h>
diff --git a/src/northbridge/intel/nehalem/gma.c b/src/northbridge/intel/nehalem/gma.c
index 86fc583..16f1c35 100644
--- a/src/northbridge/intel/nehalem/gma.c
+++ b/src/northbridge/intel/nehalem/gma.c
@@ -21,7 +21,6 @@
#include <device/device.h>
#include <device/pci.h>
#include <device/pci_ids.h>
-#include <string.h>
#include <device/pci_ops.h>
#include <drivers/intel/gma/edid.h>
#include <drivers/intel/gma/i915.h>
diff --git a/src/northbridge/intel/nehalem/northbridge.c b/src/northbridge/intel/nehalem/northbridge.c
index 8a4f64c..575c600 100644
--- a/src/northbridge/intel/nehalem/northbridge.c
+++ b/src/northbridge/intel/nehalem/northbridge.c
@@ -26,7 +26,6 @@
#include <device/pci.h>
#include <device/pci_ids.h>
#include <stdlib.h>
-#include <string.h>
#include <cpu/cpu.h>
#include "chip.h"
#include "nehalem.h"
diff --git a/src/northbridge/intel/nehalem/smi.c b/src/northbridge/intel/nehalem/smi.c
index 6aefc9b..5bfc934 100644
--- a/src/northbridge/intel/nehalem/smi.c
+++ b/src/northbridge/intel/nehalem/smi.c
@@ -14,7 +14,6 @@
#define __SIMPLE_DEVICE__
#include <types.h>
-#include <string.h>
#include <device/device.h>
#include <device/pci.h>
#include <device/pci_ops.h>
diff --git a/src/northbridge/intel/pineview/early_init.c b/src/northbridge/intel/pineview/early_init.c
index 4f28474..a0d5305 100644
--- a/src/northbridge/intel/pineview/early_init.c
+++ b/src/northbridge/intel/pineview/early_init.c
@@ -21,7 +21,6 @@
#include <device/pci_ops.h>
#include <device/pci_def.h>
#include <device/pci.h>
-#include <string.h>
#include <northbridge/intel/pineview/pineview.h>
#include <northbridge/intel/pineview/chip.h>
#include <pc80/mc146818rtc.h>
diff --git a/src/northbridge/intel/pineview/gma.c b/src/northbridge/intel/pineview/gma.c
index 8bacc77..d6ece9d 100644
--- a/src/northbridge/intel/pineview/gma.c
+++ b/src/northbridge/intel/pineview/gma.c
@@ -22,7 +22,6 @@
#include <device/device.h>
#include <device/pci.h>
#include <device/pci_ids.h>
-#include <string.h>
#include <device/pci_ops.h>
#include <drivers/intel/gma/i915_reg.h>
diff --git a/src/northbridge/intel/pineview/northbridge.c b/src/northbridge/intel/pineview/northbridge.c
index 5ddcd73..4b67cfd 100644
--- a/src/northbridge/intel/pineview/northbridge.c
+++ b/src/northbridge/intel/pineview/northbridge.c
@@ -21,7 +21,6 @@
#include <device/device.h>
#include <device/pci.h>
#include <stdlib.h>
-#include <string.h>
#include <cpu/cpu.h>
#include <boot/tables.h>
#include <arch/acpi.h>
diff --git a/src/northbridge/intel/sandybridge/gma.c b/src/northbridge/intel/sandybridge/gma.c
index d302c52..7f7ea0c 100644
--- a/src/northbridge/intel/sandybridge/gma.c
+++ b/src/northbridge/intel/sandybridge/gma.c
@@ -18,7 +18,6 @@
#include <console/console.h>
#include <bootmode.h>
#include <delay.h>
-#include <string.h>
#include <device/device.h>
#include <device/pci.h>
#include <device/pci_ids.h>
diff --git a/src/northbridge/intel/sandybridge/northbridge.c b/src/northbridge/intel/sandybridge/northbridge.c
index e58a0eb..477c26e 100644
--- a/src/northbridge/intel/sandybridge/northbridge.c
+++ b/src/northbridge/intel/sandybridge/northbridge.c
@@ -25,7 +25,6 @@
#include <device/pci.h>
#include <device/pci_ids.h>
#include <stdlib.h>
-#include <string.h>
#include <cpu/cpu.h>
#include "chip.h"
#include "sandybridge.h"
diff --git a/src/northbridge/intel/sandybridge/romstage.c b/src/northbridge/intel/sandybridge/romstage.c
index d48bac4..b49165c 100644
--- a/src/northbridge/intel/sandybridge/romstage.c
+++ b/src/northbridge/intel/sandybridge/romstage.c
@@ -16,7 +16,6 @@
*/
#include <stdint.h>
-#include <string.h>
#include <console/console.h>
#include <arch/io.h>
#include <device/pci_ops.h>
diff --git a/src/northbridge/intel/x4x/acpi.c b/src/northbridge/intel/x4x/acpi.c
index da9ed40..fb04fd8 100644
--- a/src/northbridge/intel/x4x/acpi.c
+++ b/src/northbridge/intel/x4x/acpi.c
@@ -16,7 +16,6 @@
*/
#include <types.h>
-#include <string.h>
#include <console/console.h>
#include <arch/acpi.h>
#include <arch/acpigen.h>
diff --git a/src/northbridge/intel/x4x/gma.c b/src/northbridge/intel/x4x/gma.c
index 8de568a..2c045e6 100644
--- a/src/northbridge/intel/x4x/gma.c
+++ b/src/northbridge/intel/x4x/gma.c
@@ -20,7 +20,6 @@
#include <device/device.h>
#include <device/pci.h>
#include <device/pci_ids.h>
-#include <string.h>
#include <device/pci_ops.h>
#include <commonlib/helpers.h>
#include <cbmem.h>
diff --git a/src/northbridge/intel/x4x/northbridge.c b/src/northbridge/intel/x4x/northbridge.c
index ba51430..b6616e1 100644
--- a/src/northbridge/intel/x4x/northbridge.c
+++ b/src/northbridge/intel/x4x/northbridge.c
@@ -21,7 +21,6 @@
#include <device/device.h>
#include <device/pci.h>
#include <stdlib.h>
-#include <string.h>
#include <cpu/cpu.h>
#include <boot/tables.h>
#include <arch/acpi.h>