Skip to contentSkip to conversation

global: Remove duplicate common.h inclusions

PATCH In review Tom Rini 5 participants 25 messages Nov 22, 2023 – Dec 9, 2023

Subsystems (22)
lore
Share & tools
lore

Tom Rini

author
#0 lore raw

PATCH 1/11 global: Remove duplicate common.h inclusions

These files include <common.h> twice. Start by removing the second inclusion of the file.

---
 board/data_modul/common/common.c          | 1 -
 board/grinn/liteboard/board.c             | 1 -
 board/toradex/colibri_imx7/colibri_imx7.c | 1 -
 board/wandboard/wandboard.c               | 1 -
 drivers/gpio/gpio-aspeed.c                | 1 -
 drivers/spi/fsl_dspi.c                    | 1 -
 drivers/video/exynos/exynos_dp.c          | 1 -
 7 files changed, 7 deletions(-)
board/data_modul/common/common.c +0 -1
index bf9a11472d11..4f308dad2e4d 100644
@@ -12,7 +12,6 @@
 #include <asm/io.h>
 #include <asm/mach-imx/boot_mode.h>
 #include <asm/mach-imx/iomux-v3.h>
-#include <common.h>
 #include <dm/uclass.h>
 #include <hang.h>
 #include <i2c_eeprom.h>
board/grinn/liteboard/board.c +0 -1
index 48392c48e5cc..cf1d7cee9252 100644
@@ -20,7 +20,6 @@
 #include <asm/mach-imx/iomux-v3.h>
 #include <asm/mach-imx/boot_mode.h>
 #include <asm/io.h>
-#include <common.h>
 #include <env.h>
 #include <fsl_esdhc_imx.h>
 #include <linux/sizes.h>
board/toradex/colibri_imx7/colibri_imx7.c +0 -1
index f0356af0082b..3c4a14148719 100644
@@ -16,7 +16,6 @@
 #include <asm/gpio.h>
 #include <asm/mach-imx/iomux-v3.h>
 #include <asm/io.h>
-#include <common.h>
 #include <dm.h>
 #include <dm/platform_data/serial_mxc.h>
 #include <fdt_support.h>
board/wandboard/wandboard.c +0 -1
index 48914450a294..8be62c86695d 100644
@@ -28,7 +28,6 @@
 #include <env.h>
 #include <linux/delay.h>
 #include <linux/sizes.h>
-#include <common.h>
 #include <miiphy.h>
 #include <netdev.h>
 #include <phy.h>
drivers/gpio/gpio-aspeed.c +0 -1
index 2c5415c671d1..1c3d18796b3a 100644
@@ -11,7 +11,6 @@
 #include <asm/gpio.h>
 
 #include <config.h>
-#include <common.h>
 #include <clk.h>
 #include <dm.h>
 #include <asm/io.h>
drivers/spi/fsl_dspi.c +0 -1
index f8ec268812ca..041abe57e355 100644
@@ -14,7 +14,6 @@
 #include <common.h>
 #include <dm.h>
 #include <errno.h>
-#include <common.h>
 #include <log.h>
 #include <spi.h>
 #include <malloc.h>
drivers/video/exynos/exynos_dp.c +0 -1
index a532d5ae1abb..59838da6c926 100644
@@ -7,7 +7,6 @@
 
 #include <common.h>
 #include <dm.h>
-#include <common.h>
 #include <display.h>
 #include <fdtdec.h>
 #include <log.h>
Signature · 1 line
2.34.1
author
#1 lore raw

PATCH 2/11 arm: Remove <asm/types.h> from asm/global_data.h

We need and include <linux/types.h> and this in turn already includes <asm/types.h>, so drop it here.

---
 arch/arm/include/asm/global_data.h | 1 -
 1 file changed, 1 deletion(-)
arch/arm/include/asm/global_data.h +0 -1
index 75bd9d56f893..2bb978d66839 100644
@@ -11,7 +11,6 @@
 
 #include <config.h>
 
-#include <asm/types.h>
 #include <linux/types.h>
 
 /* Architecture-specific global data */
Signature · 1 line
2.34.1
Reviewed-by on v1 2/11
#2 lore raw

Re: [PATCH 02/11] arm: Remove <asm/types.h> from asm/global_data.h

Quoted 8 lines · Tom Rini

We need and include <linux/types.h> and this in turn already includes <asm/types.h>, so drop it here.

---
 arch/arm/include/asm/global_data.h | 1 -
 1 file changed, 1 deletion(-)
author
#3 lore raw

PATCH 3/11 sandbox: Add <linux/types.h> to asm/global_data.h and asm/io.h

In reply to Tom Rini

We need <linux/types.h> in these files as we reference Linux types.

---
Cc: Simon Glass <[email protected]>

---
 arch/sandbox/include/asm/global_data.h | 2 ++
 arch/sandbox/include/asm/io.h          | 2 ++
 2 files changed, 4 insertions(+)
arch/sandbox/include/asm/global_data.h +2 -0
index c6977735029d..001b2b53c1c8 100644
@@ -9,6 +9,8 @@
 #ifndef	__ASM_GBL_DATA_H
 #define __ASM_GBL_DATA_H
 
+#include <linux/types.h>
+
 /* Architecture-specific global data */
 struct arch_global_data {
 	uint8_t		*ram_buf;	/* emulated RAM buffer */
arch/sandbox/include/asm/io.h +2 -0
index 31ab7289b4bd..1ccb25a0fe1e 100644
@@ -6,6 +6,8 @@
 #ifndef __SANDBOX_ASM_IO_H
 #define __SANDBOX_ASM_IO_H
 
+#include <linux/types.h>
+
 enum sandboxio_size_t {
 	SB_SIZE_8,
 	SB_SIZE_16,
Signature · 1 line
2.34.1
author
#5 lore raw

PATCH 4/11 m68k: Rework asm/global_data.h slightly

In reply to Tom Rini

In the architecture global data, replace the one case of u32 with unsigned long. Now, we can drop config.h here but then do need to add it in two m68k-centric spaces.

---
Cc: Huan Wang <[email protected]>
Cc: Angelo Dureghello <[email protected]>

---
 arch/m68k/include/asm/cache.h       | 2 ++
 arch/m68k/include/asm/global_data.h | 4 +---
 arch/m68k/lib/traps.c               | 1 +
 3 files changed, 4 insertions(+), 3 deletions(-)
arch/m68k/include/asm/cache.h +2 -0
index 8ed2b4dbab47..6ef7f7be1af8 100644
@@ -9,6 +9,8 @@
 #ifndef __CACHE_H
 #define __CACHE_H
 
+#include <config.h>
+
 #if defined(CONFIG_MCF520x) || defined(CONFIG_MCF523x) || \
     defined(CONFIG_MCF52x2)
 #define CFG_CF_V2
arch/m68k/include/asm/global_data.h +1 -3
index 5f576ba16f9a..c2ef5770a3df 100644
@@ -7,8 +7,6 @@
 #ifndef	__ASM_GBL_DATA_H
 #define __ASM_GBL_DATA_H
 
-#include <config.h>
-
 /* Architecture-specific global data */
 struct arch_global_data {
 #ifdef CONFIG_SYS_I2C_FSL
@@ -24,7 +22,7 @@ struct arch_global_data {
 	unsigned long sdhc_clk;
 #endif
 #if defined(CONFIG_FSL_ESDHC)
-	u32 sdhc_per_clk;
+	unsigned long sdhc_per_clk;
 #endif
 };
 
arch/m68k/lib/traps.c +1 -0
index c283351181d8..2a025c5a6e86 100644
@@ -7,6 +7,7 @@
  * Wolfgang Denk, DENX Software Engineering, [email protected].
  */
 
+#include <config.h>
 #include <init.h>
 #include <watchdog.h>
 #include <command.h>
Signature · 1 line
2.34.1
#6 lore raw

Re: [PATCH 04/11] m68k: Rework asm/global_data.h slightly

Hi Tom,

thanks,

Quoted 54 lines · Tom Rini

In the architecture global data, replace the one case of u32 with unsigned long. Now, we can drop config.h here but then do need to add it in two m68k-centric spaces.

---
Cc: Huan Wang <[email protected]>
Cc: Angelo Dureghello <[email protected]>

---
  arch/m68k/include/asm/cache.h       | 2 ++
  arch/m68k/include/asm/global_data.h | 4 +---
  arch/m68k/lib/traps.c               | 1 +
  3 files changed, 4 insertions(+), 3 deletions(-)
arch/m68k/include/asm/cache.h +2 -0
index 8ed2b4dbab47..6ef7f7be1af8 100644
@@ -9,6 +9,8 @@
  #ifndef __CACHE_H
  #define __CACHE_H
 
+#include <config.h>
+
  #if defined(CONFIG_MCF520x) || defined(CONFIG_MCF523x) || \
      defined(CONFIG_MCF52x2)
  #define CFG_CF_V2
arch/m68k/include/asm/global_data.h +1 -3
index 5f576ba16f9a..c2ef5770a3df 100644
@@ -7,8 +7,6 @@
  #ifndef	__ASM_GBL_DATA_H
  #define __ASM_GBL_DATA_H
 
-#include <config.h>
-
  /* Architecture-specific global data */
  struct arch_global_data {
  #ifdef CONFIG_SYS_I2C_FSL
@@ -24,7 +22,7 @@ struct arch_global_data {
  	unsigned long sdhc_clk;
  #endif
  #if defined(CONFIG_FSL_ESDHC)
-	u32 sdhc_per_clk;
+	unsigned long sdhc_per_clk;
  #endif
  };
 
arch/m68k/lib/traps.c +0 -0
index c283351181d8..2a025c5a6e86 100644

arch/m68k/lib/traps.c line 13

Quoted 7 lines
arch/m68k/lib/traps.c +1 -0
@@ -7,6 +7,7 @@
   * Wolfgang Denk, DENX Software Engineering, [email protected].
   */
 
+#include <config.h>
  #include <init.h>
  #include <watchdog.h>
  #include <command.h>

testing this getting some errors

+drivers/watchdog/mcf_wdt.c: In function 'mcf_watchdog_init':
+drivers/watchdog/mcf_wdt.c:43:26: error: 'CFG_SYS_CLK' undeclared (first use in this function)
+ 43 | cycles_per_sec = CFG_SYS_CLK / fixed_divider;
+ | ^~~~~~~~~~~

Seems solved by

drivers/watchdog/mcf_wdt.c +1 -0
index b555bbeb68..f5ff221dd5 100644
@@ -11,6 +11,7 @@
 #include <asm/io.h>
 #include <wdt.h>
 #include <linux/bitops.h>
+#include <config.h>
 

Regards,
angelo

author
#7 lore raw

Re: [PATCH 04/11] m68k: Rework asm/global_data.h slightly

Quoted 80 lines · Angelo Dureghello

Hi Tom,

thanks,

Quoted 51 lines · Tom Rini

In the architecture global data, replace the one case of u32 with unsigned long. Now, we can drop config.h here but then do need to add it in two m68k-centric spaces.

---
Cc: Huan Wang <[email protected]>
Cc: Angelo Dureghello <[email protected]>

---
  arch/m68k/include/asm/cache.h       | 2 ++
  arch/m68k/include/asm/global_data.h | 4 +---
  arch/m68k/lib/traps.c               | 1 +
  3 files changed, 4 insertions(+), 3 deletions(-)
arch/m68k/include/asm/cache.h +2 -0
index 8ed2b4dbab47..6ef7f7be1af8 100644
@@ -9,6 +9,8 @@
  #ifndef __CACHE_H
  #define __CACHE_H
+#include <config.h>
+
  #if defined(CONFIG_MCF520x) || defined(CONFIG_MCF523x) || \
      defined(CONFIG_MCF52x2)
  #define CFG_CF_V2
arch/m68k/include/asm/global_data.h +1 -3
index 5f576ba16f9a..c2ef5770a3df 100644
@@ -7,8 +7,6 @@
  #ifndef	__ASM_GBL_DATA_H
  #define __ASM_GBL_DATA_H
-#include <config.h>
-
  /* Architecture-specific global data */
  struct arch_global_data {
  #ifdef CONFIG_SYS_I2C_FSL
@@ -24,7 +22,7 @@ struct arch_global_data {
  	unsigned long sdhc_clk;
  #endif
  #if defined(CONFIG_FSL_ESDHC)
-	u32 sdhc_per_clk;
+	unsigned long sdhc_per_clk;
  #endif
  };
arch/m68k/lib/traps.c +0 -0
index c283351181d8..2a025c5a6e86 100644

arch/m68k/lib/traps.c line 12

Quoted 6 lines
arch/m68k/lib/traps.c +1 -0
@@ -7,6 +7,7 @@
   * Wolfgang Denk, DENX Software Engineering, [email protected].
   */
+#include <config.h>
  #include <init.h>
  #include <watchdog.h>
  #include <command.h>

testing this getting some errors

(quoted diff) +2 -0
+drivers/watchdog/mcf_wdt.c: In function 'mcf_watchdog_init':
+drivers/watchdog/mcf_wdt.c:43:26: error: 'CFG_SYS_CLK' undeclared (first

use in this function)

(quoted diff) +2 -0
+   43 |         cycles_per_sec = CFG_SYS_CLK / fixed_divider;
+      |                          ^~~~~~~~~~~

Seems solved by

drivers/watchdog/mcf_wdt.c +0 -0
index b555bbeb68..f5ff221dd5 100644

drivers/watchdog/mcf_wdt.c line 14

Quoted 4 lines
drivers/watchdog/mcf_wdt.c +1 -0
@@ -11,6 +11,7 @@
 #include <asm/io.h>
 #include <wdt.h>
 #include <linux/bitops.h>
+#include <config.h>

Did you have the whole series applied? That is a reasonable solution, but I didn't see a failure here, thanks for the report.

Signature · 1 line
Tom
#8 lore raw

Re: [PATCH 04/11] m68k: Rework asm/global_data.h slightly

Hi Tom,

sorry, i have difficulties to get the full patchset, was also looking into patchwork, but seems not updated.

Anyway, i applied patches one by one, all is ok.

Quoted 89 lines · Tom Rini
Quoted 80 lines · Angelo Dureghello

Hi Tom,

thanks,

Quoted 51 lines · Tom Rini

In the architecture global data, replace the one case of u32 with unsigned long. Now, we can drop config.h here but then do need to add it in two m68k-centric spaces.

---
Cc: Huan Wang <[email protected]>
Cc: Angelo Dureghello <[email protected]>

---
   arch/m68k/include/asm/cache.h       | 2 ++
   arch/m68k/include/asm/global_data.h | 4 +---
   arch/m68k/lib/traps.c               | 1 +
   3 files changed, 4 insertions(+), 3 deletions(-)
arch/m68k/include/asm/cache.h +2 -0
index 8ed2b4dbab47..6ef7f7be1af8 100644
@@ -9,6 +9,8 @@
   #ifndef __CACHE_H
   #define __CACHE_H
+#include <config.h>
+
   #if defined(CONFIG_MCF520x) || defined(CONFIG_MCF523x) || \
       defined(CONFIG_MCF52x2)
   #define CFG_CF_V2
arch/m68k/include/asm/global_data.h +1 -3
index 5f576ba16f9a..c2ef5770a3df 100644
@@ -7,8 +7,6 @@
   #ifndef	__ASM_GBL_DATA_H
   #define __ASM_GBL_DATA_H
-#include <config.h>
-
   /* Architecture-specific global data */
   struct arch_global_data {
   #ifdef CONFIG_SYS_I2C_FSL
@@ -24,7 +22,7 @@ struct arch_global_data {
   	unsigned long sdhc_clk;
   #endif
   #if defined(CONFIG_FSL_ESDHC)
-	u32 sdhc_per_clk;
+	unsigned long sdhc_per_clk;
   #endif
   };
arch/m68k/lib/traps.c +0 -0
index c283351181d8..2a025c5a6e86 100644

arch/m68k/lib/traps.c line 12

Quoted 6 lines
arch/m68k/lib/traps.c +1 -0
@@ -7,6 +7,7 @@
    * Wolfgang Denk, DENX Software Engineering, [email protected].
    */
+#include <config.h>
   #include <init.h>
   #include <watchdog.h>
   #include <command.h>

testing this getting some errors

(quoted diff) +2 -0
+drivers/watchdog/mcf_wdt.c: In function 'mcf_watchdog_init':
+drivers/watchdog/mcf_wdt.c:43:26: error: 'CFG_SYS_CLK' undeclared (first

use in this function)

(quoted diff) +2 -0
+   43 |         cycles_per_sec = CFG_SYS_CLK / fixed_divider;
+      |                          ^~~~~~~~~~~

Seems solved by

drivers/watchdog/mcf_wdt.c +0 -0
index b555bbeb68..f5ff221dd5 100644

drivers/watchdog/mcf_wdt.c line 14

Quoted 4 lines
drivers/watchdog/mcf_wdt.c +1 -0
@@ -11,6 +11,7 @@
  #include <asm/io.h>
  #include <wdt.h>
  #include <linux/bitops.h>
+#include <config.h>

Did you have the whole series applied? That is a reasonable solution, but I didn't see a failure here, thanks for the report.

author
#9 lore raw

PATCH 5/11 global: Rework architecture global_data.h to include <linux/types.h>

In reply to Tom Rini

In most cases, the architecture global data currently makes use of assorted linux types, but does not include <linux/types.h> to provide them. Add <linux/types.h> instead of relying on indirect inclusion.

---
 arch/mips/include/asm/global_data.h    | 2 +-
 arch/nios2/include/asm/global_data.h   | 2 ++
 arch/powerpc/include/asm/global_data.h | 3 +--
 arch/riscv/include/asm/global_data.h   | 1 +
 arch/x86/include/asm/global_data.h     | 1 +
 5 files changed, 6 insertions(+), 3 deletions(-)
arch/mips/include/asm/global_data.h +1 -1
index f0d3b07bf1eb..34b7e0bed945 100644
@@ -7,8 +7,8 @@
 #ifndef	__ASM_GBL_DATA_H
 #define __ASM_GBL_DATA_H
 
+#include <linux/types.h>
 #include <asm/regdef.h>
-#include <asm/types.h>
 
 struct octeon_eeprom_mac_addr {
 	u8 mac_addr_base[6];
arch/nios2/include/asm/global_data.h +2 -0
index 1a0e7d25fa3b..b56e8a5078e0 100644
@@ -6,6 +6,8 @@
 #ifndef	__ASM_NIOS2_GLOBALDATA_H_
 #define __ASM_NIOS2_GLOBALDATA_H_
 
+#include <linux/types.h>
+
 /* Architecture-specific global data */
 struct arch_global_data {
 	u32 dcache_line_size;
arch/powerpc/include/asm/global_data.h +1 -2
index 6ed21c781fe4..f7860122a00b 100644
@@ -8,8 +8,7 @@
 #ifndef	__ASM_GBL_DATA_H
 #define __ASM_GBL_DATA_H
 
-#include <config.h>
-#include "asm/types.h"
+#include <linux/types.h>
 
 /* Architecture-specific global data */
 struct arch_global_data {
arch/riscv/include/asm/global_data.h +1 -0
index 937fa4d15446..d00247ad9536 100644
@@ -10,6 +10,7 @@
 #ifndef	__ASM_GBL_DATA_H
 #define __ASM_GBL_DATA_H
 
+#include <linux/types.h>
 #include <asm/smp.h>
 #include <asm/u-boot.h>
 #include <compiler.h>
arch/x86/include/asm/global_data.h +1 -0
index 6f4a7130f1da..1ef7f1f0349e 100644
@@ -9,6 +9,7 @@
 
 #ifndef __ASSEMBLY__
 
+#include <linux/types.h>
 #include <asm/processor.h>
 #include <asm/mrccache.h>
 
Signature · 1 line
2.34.1
Reviewed-by on v1 5/11
#10 lore raw

Re: [PATCH 05/11] global: Rework architecture global_data.h to include <linux/types.h>

Quoted 5 lines · Tom Rini

In most cases, the architecture global data currently makes use of assorted linux types, but does not include <linux/types.h> to provide them. Add <linux/types.h> instead of relying on indirect inclusion.

Quoted 9 lines
---
 arch/mips/include/asm/global_data.h    | 2 +-
 arch/nios2/include/asm/global_data.h   | 2 ++
 arch/powerpc/include/asm/global_data.h | 3 +--
 arch/riscv/include/asm/global_data.h   | 1 +
 arch/x86/include/asm/global_data.h     | 1 +
 5 files changed, 6 insertions(+), 3 deletions(-)
author
#11 lore raw

PATCH 6/11 lib/sha*.c: Update header list

In reply to Tom Rini

Cleanup the list of headers we include here. For the tools build we only need to exclude <cyclic.h> as that's used by the target build for the prototype for schedule(), and we don't need to get that via <watchdog.h>. We can also make use of our <string.h> intentionally existing as a redirection to <linux/string.h> to reduce ifdef'd lines.

---
 lib/sha1.c   | 7 ++-----
 lib/sha256.c | 7 ++-----
 lib/sha512.c | 6 +-----
 3 files changed, 5 insertions(+), 15 deletions(-)
lib/sha1.c +2 -5
index 8d0740789349..7ef536f4b5db 100644
@@ -17,12 +17,9 @@
 #endif
 
 #ifndef USE_HOSTCC
-#include <common.h>
-#include <linux/string.h>
-#else
-#include <string.h>
+#include <cyclic.h>
 #endif /* USE_HOSTCC */
-#include <watchdog.h>
+#include <string.h>
 #include <u-boot/sha1.h>
 
 #include <linux/compiler_attributes.h>
lib/sha256.c +2 -5
index 4d26aea1c8ce..665ba6f152e5 100644
@@ -6,12 +6,9 @@
  */
 
 #ifndef USE_HOSTCC
-#include <common.h>
-#include <linux/string.h>
-#else
-#include <string.h>
+#include <cyclic.h>
 #endif /* USE_HOSTCC */
-#include <watchdog.h>
+#include <string.h>
 #include <u-boot/sha256.h>
 
 #include <linux/compiler_attributes.h>
lib/sha512.c +1 -5
index fbe8d5f5bfe9..ffe2c5cd9642 100644
@@ -11,13 +11,9 @@
  */
 
 #ifndef USE_HOSTCC
-#include <common.h>
-#include <linux/string.h>
-#else
-#include <string.h>
+#include <cyclic.h>
 #endif /* USE_HOSTCC */
 #include <compiler.h>
-#include <watchdog.h>
 #include <u-boot/sha512.h>
 
 const uint8_t sha384_der_prefix[SHA384_DER_LEN] = {
Signature · 1 line
2.34.1
#12 lore raw

Re: [PATCH 06/11] lib/sha*.c: Update header list

Hi Tom,

Quoted 7 lines · Tom Rini

Cleanup the list of headers we include here. For the tools build we only need to exclude <cyclic.h> as that's used by the target build for the prototype for schedule(), and we don't need to get that via <watchdog.h>. We can also make use of our <string.h> intentionally existing as a redirection to <linux/string.h> to reduce ifdef'd lines.

Quoted 6 lines
---
 lib/sha1.c   | 7 ++-----
 lib/sha256.c | 7 ++-----
 lib/sha512.c | 6 +-----
 3 files changed, 5 insertions(+), 15 deletions(-)

As mentioned in my series this will prevent dropping the #ifdefs in this file:

#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)

Actually I see that I didn't send the v2 so I just did that now[1].

Regards,
Simon

[1] https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/

author
#13 lore raw

Re: [PATCH 06/11] lib/sha*.c: Update header list

Quoted 19 lines · Simon Glass

Hi Tom,

Quoted 7 lines · Tom Rini

Cleanup the list of headers we include here. For the tools build we only need to exclude <cyclic.h> as that's used by the target build for the prototype for schedule(), and we don't need to get that via <watchdog.h>. We can also make use of our <string.h> intentionally existing as a redirection to <linux/string.h> to reduce ifdef'd lines.

Quoted 6 lines
---
 lib/sha1.c   | 7 ++-----
 lib/sha256.c | 7 ++-----
 lib/sha512.c | 6 +-----
 3 files changed, 5 insertions(+), 15 deletions(-)

As mentioned in my series this will prevent dropping the #ifdefs in this file:

Quoted 8 lines

#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)

Actually I see that I didn't send the v2 so I just did that now[1].

Regards,
Simon

[1] https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/

Yes, I prefer what I did here instead of [1].

Signature · 1 line
Tom
author
#14 lore raw

PATCH 7/11 rmobile: Add <mach/rmobile.h> to cpu_info-rzg2l.c

In reply to Tom Rini

In order for RMOBILE_CPU_TYPE_R9A07G044L to be defined we need to include <mach/rmobile.h> here.

---
Cc: Nobuhiro Iwamatsu <[email protected]>
Cc: Marek Vasut <[email protected]>
Cc: Paul Barker <[email protected]>

---
 arch/arm/mach-rmobile/cpu_info-rzg2l.c | 1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-rmobile/cpu_info-rzg2l.c +1 -0
index f69649dc7eaf..bd3146fb011f 100644
@@ -4,6 +4,7 @@
  *
  */
 
+#include <mach/rmobile.h>
 #include <asm/io.h>
 #include <linux/libfdt.h>
 
Signature · 1 line
2.34.1
author
#16 lore raw

PATCH 8/11 efi_loader: Remove <common.h>

In reply to Tom Rini

We largely do not need <common.h> in these files, so drop it. The only exception here is that efi_freestanding.c needs <linux/types.h> and had been getting that via <common.h>.

---
Cc: Heinrich Schuchardt <[email protected]>
Cc: Ilias Apalodimas <[email protected]>

---
 include/efi_loader.h                       | 1 -
 lib/efi_loader/dtbdump.c                   | 1 -
 lib/efi_loader/efi_acpi.c                  | 1 -
 lib/efi_loader/efi_bootmgr.c               | 1 -
 lib/efi_loader/efi_boottime.c              | 1 -
 lib/efi_loader/efi_capsule.c               | 1 -
 lib/efi_loader/efi_conformance.c           | 1 -
 lib/efi_loader/efi_console.c               | 1 -
 lib/efi_loader/efi_device_path.c           | 1 -
 lib/efi_loader/efi_device_path_to_text.c   | 1 -
 lib/efi_loader/efi_device_path_utilities.c | 1 -
 lib/efi_loader/efi_disk.c                  | 1 -
 lib/efi_loader/efi_dt_fixup.c              | 1 -
 lib/efi_loader/efi_esrt.c                  | 1 -
 lib/efi_loader/efi_file.c                  | 1 -
 lib/efi_loader/efi_firmware.c              | 1 -
 lib/efi_loader/efi_freestanding.c          | 2 +-
 lib/efi_loader/efi_gop.c                   | 1 -
 lib/efi_loader/efi_helper.c                | 1 -
 lib/efi_loader/efi_hii.c                   | 1 -
 lib/efi_loader/efi_hii_config.c            | 1 -
 lib/efi_loader/efi_image_loader.c          | 1 -
 lib/efi_loader/efi_load_initrd.c           | 1 -
 lib/efi_loader/efi_load_options.c          | 1 -
 lib/efi_loader/efi_memory.c                | 1 -
 lib/efi_loader/efi_net.c                   | 1 -
 lib/efi_loader/efi_riscv.c                 | 1 -
 lib/efi_loader/efi_rng.c                   | 1 -
 lib/efi_loader/efi_root_node.c             | 1 -
 lib/efi_loader/efi_runtime.c               | 1 -
 lib/efi_loader/efi_setup.c                 | 1 -
 lib/efi_loader/efi_signature.c             | 1 -
 lib/efi_loader/efi_smbios.c                | 1 -
 lib/efi_loader/efi_string.c                | 1 -
 lib/efi_loader/efi_tcg2.c                  | 1 -
 lib/efi_loader/efi_unicode_collation.c     | 1 -
 lib/efi_loader/efi_var_common.c            | 1 -
 lib/efi_loader/efi_var_file.c              | 1 -
 lib/efi_loader/efi_var_mem.c               | 1 -
 lib/efi_loader/efi_variable.c              | 1 -
 lib/efi_loader/efi_variable_tee.c          | 1 -
 lib/efi_loader/efi_watchdog.c              | 1 -
 lib/efi_loader/initrddump.c                | 1 -
 43 files changed, 1 insertion(+), 43 deletions(-)
include/efi_loader.h +0 -1
index e24410505f40..247be060e1c0 100644
@@ -8,7 +8,6 @@
 #ifndef _EFI_LOADER_H
 #define _EFI_LOADER_H 1
 
-#include <common.h>
 #include <blk.h>
 #include <event.h>
 #include <log.h>
lib/efi_loader/dtbdump.c +0 -1
index 3ce2a07f9eb0..5f39cf22da79 100644
@@ -6,7 +6,6 @@
  * to a file.
  */
 
-#include <common.h>
 #include <efi_api.h>
 #include <efi_dt_fixup.h>
 #include <part.h>
lib/efi_loader/efi_acpi.c +0 -1
index f755af76f866..67bbd2a01c0b 100644
@@ -5,7 +5,6 @@
  *  Copyright (C) 2018, Bin Meng <[email protected]>
  */
 
-#include <common.h>
 #include <efi_loader.h>
 #include <log.h>
 #include <mapmem.h>
lib/efi_loader/efi_bootmgr.c +0 -1
index a40762c74c83..47691d8a3d4d 100644
@@ -7,7 +7,6 @@
 
 #define LOG_CATEGORY LOGC_EFI
 
-#include <common.h>
 #include <charset.h>
 #include <log.h>
 #include <malloc.h>
lib/efi_loader/efi_boottime.c +0 -1
index 0b7579cb5af1..f82b1a809f8f 100644
@@ -5,7 +5,6 @@
  * Copyright (c) 2016 Alexander Graf
  */
 
-#include <common.h>
 #include <bootm.h>
 #include <div64.h>
 #include <dm/device.h>
lib/efi_loader/efi_capsule.c +0 -1
index af8a2ee940ce..de0d49ebebda 100644
@@ -8,7 +8,6 @@
 
 #define LOG_CATEGORY LOGC_EFI
 
-#include <common.h>
 #include <efi_loader.h>
 #include <efi_variable.h>
 #include <env.h>
lib/efi_loader/efi_conformance.c +0 -1
index 0ca26f57a7f2..167067e26cd1 100644
@@ -5,7 +5,6 @@
  *  Copyright (C) 2022 Arm Ltd.
  */
 
-#include <common.h>
 #include <efi_loader.h>
 #include <log.h>
 #include <efi_api.h>
lib/efi_loader/efi_console.c +0 -1
index a2d137d7a9e1..03dece51aeaa 100644
@@ -8,7 +8,6 @@
 #define LOG_CATEGORY LOGC_EFI
 
 #include <ansi.h>
-#include <common.h>
 #include <charset.h>
 #include <malloc.h>
 #include <time.h>
lib/efi_loader/efi_device_path.c +0 -1
index ed7214f3a347..8dbd8105ae26 100644
@@ -7,7 +7,6 @@
 
 #define LOG_CATEGORY LOGC_EFI
 
-#include <common.h>
 #include <blk.h>
 #include <dm.h>
 #include <dm/root.h>
lib/efi_loader/efi_device_path_to_text.c +0 -1
index 8c76d8be605d..0c7b30a26e7e 100644
@@ -5,7 +5,6 @@
  *  Copyright (c) 2017 Heinrich Schuchardt
  */
 
-#include <common.h>
 #include <blk.h>
 #include <efi_loader.h>
 #include <malloc.h>
lib/efi_loader/efi_device_path_utilities.c +0 -1
index a07d9bab3a3c..844d8acd67c0 100644
@@ -5,7 +5,6 @@
  *  Copyright (c) 2017 Leif Lindholm
  */
 
-#include <common.h>
 #include <efi_loader.h>
 
 const efi_guid_t efi_guid_device_path_utilities_protocol =
lib/efi_loader/efi_disk.c +0 -1
index f0d76113b001..321f9b82b73c 100644
@@ -7,7 +7,6 @@
 
 #define LOG_CATEGORY LOGC_EFI
 
-#include <common.h>
 #include <blk.h>
 #include <dm.h>
 #include <dm/device-internal.h>
lib/efi_loader/efi_dt_fixup.c +0 -1
index 838023c78ff7..2176388f4207 100644
@@ -5,7 +5,6 @@
  * Copyright (c) 2020 Heinrich Schuchardt
  */
 
-#include <common.h>
 #include <efi_dt_fixup.h>
 #include <efi_loader.h>
 #include <efi_rng.h>
lib/efi_loader/efi_esrt.c +0 -1
index 7f46d651e6f2..dafd447b6d76 100644
@@ -5,7 +5,6 @@
  *  Copyright (C) 2021 Arm Ltd.
  */
 
-#include <common.h>
 #include <efi_loader.h>
 #include <log.h>
 #include <efi_api.h>
lib/efi_loader/efi_file.c +0 -1
index 3c56cebf9653..222001d6a3b5 100644
@@ -5,7 +5,6 @@
  * Copyright (c) 2017 Rob Clark
  */
 
-#include <common.h>
 #include <charset.h>
 #include <efi_loader.h>
 #include <log.h>
lib/efi_loader/efi_firmware.c +0 -1
index 9abb29f1dff1..1fde1885e3ca 100644
@@ -6,7 +6,6 @@
  *			Author: AKASHI Takahiro
  */
 
-#include <common.h>
 #include <charset.h>
 #include <dfu.h>
 #include <efi_loader.h>
lib/efi_loader/efi_freestanding.c +1 -1
index 4b65fc64dd04..b2786095c323 100644
@@ -8,7 +8,7 @@
  * memset(), and memcmp().
  */
 
-#include <common.h>
+#include <linux/types.h>
 
 /**
  * memcmp() - compare memory areas
lib/efi_loader/efi_gop.c +0 -1
index a09db31eb465..41e12fa72460 100644
@@ -5,7 +5,6 @@
  *  Copyright (c) 2016 Alexander Graf
  */
 
-#include <common.h>
 #include <dm.h>
 #include <efi_loader.h>
 #include <log.h>
lib/efi_loader/efi_helper.c +0 -1
index cdfd16ea7742..17f27ca1a0b2 100644
@@ -4,7 +4,6 @@
  */
 
 #define LOG_CATEGORY LOGC_EFI
-#include <common.h>
 #include <env.h>
 #include <malloc.h>
 #include <dm.h>
lib/efi_loader/efi_hii.c +0 -1
index 3b54ecb11ac1..74e402df1b8a 100644
@@ -6,7 +6,6 @@
  *  Copyright (c) 2018 AKASHI Takahiro, Linaro Limited
  */
 
-#include <common.h>
 #include <efi_loader.h>
 #include <malloc.h>
 #include <asm/unaligned.h>
lib/efi_loader/efi_hii_config.c +0 -1
index 31b0c97eb286..ae0f3ecd3b18 100644
@@ -10,7 +10,6 @@
  * the Makefile.
  */
 
-#include <common.h>
 #include <efi_loader.h>
 
 const efi_guid_t efi_guid_hii_config_routing_protocol
lib/efi_loader/efi_image_loader.c +0 -1
index 97547571ce33..604243603289 100644
@@ -9,7 +9,6 @@
 
 #define LOG_CATEGORY LOGC_EFI
 
-#include <common.h>
 #include <cpu_func.h>
 #include <efi_loader.h>
 #include <log.h>
lib/efi_loader/efi_load_initrd.c +0 -1
index 193433782c24..2b467b554810 100644
@@ -4,7 +4,6 @@
  */
 
 #define LOG_CATEGORY LOGC_EFI
-#include <common.h>
 #include <efi_loader.h>
 #include <efi_load_initrd.h>
 #include <efi_variable.h>
lib/efi_loader/efi_load_options.c +0 -1
index 5f62184da1cd..01984235e248 100644
@@ -7,7 +7,6 @@
 
 #define LOG_CATEGORY LOGC_EFI
 
-#include <common.h>
 #include <charset.h>
 #include <log.h>
 #include <malloc.h>
lib/efi_loader/efi_memory.c +0 -1
index f752703b438e..edfad2d95a1d 100644
@@ -7,7 +7,6 @@
 
 #define LOG_CATEGORY LOGC_EFI
 
-#include <common.h>
 #include <efi_loader.h>
 #include <init.h>
 #include <log.h>
lib/efi_loader/efi_net.c +0 -1
index 96a5bcca2758..7cd536705f43 100644
@@ -15,7 +15,6 @@
  * Reset():	 EfiSimpleNetworkInitialized -> EfiSimpleNetworkInitialized
  */
 
-#include <common.h>
 #include <efi_loader.h>
 #include <malloc.h>
 #include <net.h>
lib/efi_loader/efi_riscv.c +0 -1
index 064172755b95..4d398c5be348 100644
@@ -7,7 +7,6 @@
  */
 
 #define LOG_CATEGORY LOGC_EFI
-#include <common.h>
 #include <efi_loader.h>
 #include <efi_variable.h>
 #include <log.h>
lib/efi_loader/efi_rng.c +0 -1
index bb11d8d0e0cb..9bad7ed69317 100644
@@ -5,7 +5,6 @@
 
 #define LOG_CATEGORY LOGC_EFI
 
-#include <common.h>
 #include <dm.h>
 #include <efi_loader.h>
 #include <efi_rng.h>
lib/efi_loader/efi_root_node.c +0 -1
index 108c14b95bd6..4d7fb74b5d6f 100644
@@ -5,7 +5,6 @@
  *  Copyright (c) 2018 Heinrich Schuchardt
  */
 
-#include <common.h>
 #include <malloc.h>
 #include <efi_dt_fixup.h>
 #include <efi_loader.h>
lib/efi_loader/efi_runtime.c +0 -1
index bf54d6ad871d..18da6892e796 100644
@@ -5,7 +5,6 @@
  *  Copyright (c) 2016 Alexander Graf
  */
 
-#include <common.h>
 #include <command.h>
 #include <cpu_func.h>
 #include <dm.h>
lib/efi_loader/efi_setup.c +0 -1
index e6de685e8795..36f66c51921b 100644
@@ -7,7 +7,6 @@
 
 #define LOG_CATEGORY LOGC_EFI
 
-#include <common.h>
 #include <efi_loader.h>
 #include <efi_variable.h>
 #include <log.h>
lib/efi_loader/efi_signature.c +0 -1
index 742d8919402c..f338e7327599 100644
@@ -4,7 +4,6 @@
  * Copyright (c) 2019 Linaro Limited, Author: AKASHI Takahiro
  */
 
-#include <common.h>
 #include <charset.h>
 #include <efi_loader.h>
 #include <efi_variable.h>
lib/efi_loader/efi_smbios.c +0 -1
index 48446f654d9b..2a79c0b1ba60 100644
@@ -7,7 +7,6 @@
 
 #define LOG_CATEGORY LOGC_EFI
 
-#include <common.h>
 #include <efi_loader.h>
 #include <log.h>
 #include <malloc.h>
lib/efi_loader/efi_string.c +0 -1
index e21e09c94617..413e329b600c 100644
@@ -5,7 +5,6 @@
  * Copyright (c) 2020 AKASHI Takahiro, Linaro Limited
  */
 
-#include <common.h>
 #include <charset.h>
 #include <efi_loader.h>
 #include <malloc.h>
lib/efi_loader/efi_tcg2.c +0 -1
index 463ea4c15416..8db35d0b3c85 100644
@@ -8,7 +8,6 @@
  */
 
 #define LOG_CATEGORY LOGC_EFI
-#include <common.h>
 #include <dm.h>
 #include <efi_loader.h>
 #include <efi_variable.h>
lib/efi_loader/efi_unicode_collation.c +0 -1
index c4c75720634a..2b6912c50921 100644
@@ -5,7 +5,6 @@
  * Copyright (c) 2018 Heinrich Schuchardt <[email protected]>
  */
 
-#include <common.h>
 #include <charset.h>
 #include <cp1250.h>
 #include <cp437.h>
lib/efi_loader/efi_var_common.c +0 -1
index ad50bffd2b26..d528747f3fb4 100644
@@ -6,7 +6,6 @@
  * Copyright (c) 2020 Linaro Limited, Author: AKASHI Takahiro
  */
 
-#include <common.h>
 #include <efi_loader.h>
 #include <efi_variable.h>
 #include <stdlib.h>
lib/efi_loader/efi_var_file.c +0 -1
index d7dba050710a..532b6b40eefe 100644
@@ -7,7 +7,6 @@
 
 #define LOG_CATEGORY LOGC_EFI
 
-#include <common.h>
 #include <charset.h>
 #include <fs.h>
 #include <log.h>
lib/efi_loader/efi_var_mem.c +0 -1
index 5fa7dcb8d3ed..6c21cec5d457 100644
@@ -5,7 +5,6 @@
  * Copyright (c) 2020, Heinrich Schuchardt
  */
 
-#include <common.h>
 #include <efi_loader.h>
 #include <efi_variable.h>
 #include <u-boot/crc.h>
lib/efi_loader/efi_variable.c +0 -1
index be95ed44e6ef..40f7a0fb10d5 100644
@@ -7,7 +7,6 @@
 
 #define LOG_CATEGORY LOGC_EFI
 
-#include <common.h>
 #include <efi_loader.h>
 #include <efi_variable.h>
 #include <env.h>
lib/efi_loader/efi_variable_tee.c +0 -1
index 09d03c0eee78..dde135fd9f81 100644
@@ -10,7 +10,6 @@
  *    Abdellatif El Khlifi <[email protected]>
  */
 
-#include <common.h>
 #if CONFIG_IS_ENABLED(ARM_FFA_TRANSPORT)
 #include <arm_ffa.h>
 #endif
lib/efi_loader/efi_watchdog.c +0 -1
index d741076dcdd9..f5fb9117717c 100644
@@ -5,7 +5,6 @@
  *  Copyright (c) 2017 Heinrich Schuchardt
  */
 
-#include <common.h>
 #include <efi_loader.h>
 
 /* Conversion factor from seconds to multiples of 100ns */
lib/efi_loader/initrddump.c +0 -1
index 5b470f481946..0004b6b042b4 100644
@@ -9,7 +9,6 @@
  * clearing of the screen.
  */
 
-#include <common.h>
 #include <efi_api.h>
 #include <efi_load_initrd.h>
 
Signature · 1 line
2.34.1
Reviewed-by on v1 8/11
#17 lore raw

Re: [PATCH 08/11] efi_loader: Remove <common.h>

Hi Tom,
Thanks for the cleanup

Quoted 45 lines · Tom Rini

We largely do not need <common.h> in these files, so drop it. The only exception here is that efi_freestanding.c needs <linux/types.h> and had been getting that via <common.h>.

---
Cc: Heinrich Schuchardt <[email protected]>
Cc: Ilias Apalodimas <[email protected]>

---
 include/efi_loader.h                       | 1 -
 lib/efi_loader/dtbdump.c                   | 1 -
 lib/efi_loader/efi_acpi.c                  | 1 -
 lib/efi_loader/efi_bootmgr.c               | 1 -
 lib/efi_loader/efi_boottime.c              | 1 -
 lib/efi_loader/efi_capsule.c               | 1 -
 lib/efi_loader/efi_conformance.c           | 1 -
 lib/efi_loader/efi_console.c               | 1 -
 lib/efi_loader/efi_device_path.c           | 1 -
 lib/efi_loader/efi_device_path_to_text.c   | 1 -
 lib/efi_loader/efi_device_path_utilities.c | 1 -
 lib/efi_loader/efi_disk.c                  | 1 -
 lib/efi_loader/efi_dt_fixup.c              | 1 -
 lib/efi_loader/efi_esrt.c                  | 1 -
 lib/efi_loader/efi_file.c                  | 1 -
 lib/efi_loader/efi_firmware.c              | 1 -
 lib/efi_loader/efi_freestanding.c          | 2 +-
 lib/efi_loader/efi_gop.c                   | 1 -
 lib/efi_loader/efi_helper.c                | 1 -
 lib/efi_loader/efi_hii.c                   | 1 -
 lib/efi_loader/efi_hii_config.c            | 1 -
 lib/efi_loader/efi_image_loader.c          | 1 -
 lib/efi_loader/efi_load_initrd.c           | 1 -
 lib/efi_loader/efi_load_options.c          | 1 -
 lib/efi_loader/efi_memory.c                | 1 -
 lib/efi_loader/efi_net.c                   | 1 -
 lib/efi_loader/efi_riscv.c                 | 1 -
 lib/efi_loader/efi_rng.c                   | 1 -
 lib/efi_loader/efi_root_node.c             | 1 -
 lib/efi_loader/efi_runtime.c               | 1 -
 lib/efi_loader/efi_setup.c                 | 1 -
 lib/efi_loader/efi_signature.c             | 1 -
 lib/efi_loader/efi_smbios.c                | 1 -
 lib/efi_loader/efi_string.c                | 1 -
 lib/efi_loader/efi_tcg2.c                  | 1 -
 lib/efi_loader/efi_unicode_collation.c     | 1 -
Quoted 9 lines
 lib/efi_loader/efi_var_common.c            | 1 -
 lib/efi_loader/efi_var_file.c              | 1 -
 lib/efi_loader/efi_var_mem.c               | 1 -
 lib/efi_loader/efi_variable.c              | 1 -
 lib/efi_loader/efi_variable_tee.c          | 1 -
 lib/efi_loader/efi_watchdog.c              | 1 -
 lib/efi_loader/initrddump.c                | 1 -
 43 files changed, 1 insertion(+), 43 deletions(-)
Quoted 535 lines
include/efi_loader.h +0 -1
index e24410505f40..247be060e1c0 100644
@@ -8,7 +8,6 @@
 #ifndef _EFI_LOADER_H
 #define _EFI_LOADER_H 1
 
-#include <common.h>
 #include <blk.h>
 #include <event.h>
 #include <log.h>
lib/efi_loader/dtbdump.c +0 -1
index 3ce2a07f9eb0..5f39cf22da79 100644
@@ -6,7 +6,6 @@
  * to a file.
  */
 
-#include <common.h>
 #include <efi_api.h>
 #include <efi_dt_fixup.h>
 #include <part.h>
lib/efi_loader/efi_acpi.c +0 -1
index f755af76f866..67bbd2a01c0b 100644
@@ -5,7 +5,6 @@
  *  Copyright (C) 2018, Bin Meng <[email protected]>
  */
 
-#include <common.h>
 #include <efi_loader.h>
 #include <log.h>
 #include <mapmem.h>
lib/efi_loader/efi_bootmgr.c +0 -1
index a40762c74c83..47691d8a3d4d 100644
@@ -7,7 +7,6 @@
 
 #define LOG_CATEGORY LOGC_EFI
 
-#include <common.h>
 #include <charset.h>
 #include <log.h>
 #include <malloc.h>
lib/efi_loader/efi_boottime.c +0 -1
index 0b7579cb5af1..f82b1a809f8f 100644
@@ -5,7 +5,6 @@
  * Copyright (c) 2016 Alexander Graf
  */
 
-#include <common.h>
 #include <bootm.h>
 #include <div64.h>
 #include <dm/device.h>
lib/efi_loader/efi_capsule.c +0 -1
index af8a2ee940ce..de0d49ebebda 100644
@@ -8,7 +8,6 @@
 
 #define LOG_CATEGORY LOGC_EFI
 
-#include <common.h>
 #include <efi_loader.h>
 #include <efi_variable.h>
 #include <env.h>
lib/efi_loader/efi_conformance.c +0 -1
index 0ca26f57a7f2..167067e26cd1 100644
@@ -5,7 +5,6 @@
  *  Copyright (C) 2022 Arm Ltd.
  */
 
-#include <common.h>
 #include <efi_loader.h>
 #include <log.h>
 #include <efi_api.h>
lib/efi_loader/efi_console.c +0 -1
index a2d137d7a9e1..03dece51aeaa 100644
@@ -8,7 +8,6 @@
 #define LOG_CATEGORY LOGC_EFI
 
 #include <ansi.h>
-#include <common.h>
 #include <charset.h>
 #include <malloc.h>
 #include <time.h>
lib/efi_loader/efi_device_path.c +0 -1
index ed7214f3a347..8dbd8105ae26 100644
@@ -7,7 +7,6 @@
 
 #define LOG_CATEGORY LOGC_EFI
 
-#include <common.h>
 #include <blk.h>
 #include <dm.h>
 #include <dm/root.h>
lib/efi_loader/efi_device_path_to_text.c +0 -1
index 8c76d8be605d..0c7b30a26e7e 100644
@@ -5,7 +5,6 @@
  *  Copyright (c) 2017 Heinrich Schuchardt
  */
 
-#include <common.h>
 #include <blk.h>
 #include <efi_loader.h>
 #include <malloc.h>
lib/efi_loader/efi_device_path_utilities.c +0 -1
index a07d9bab3a3c..844d8acd67c0 100644
@@ -5,7 +5,6 @@
  *  Copyright (c) 2017 Leif Lindholm
  */
 
-#include <common.h>
 #include <efi_loader.h>
 
 const efi_guid_t efi_guid_device_path_utilities_protocol =
lib/efi_loader/efi_disk.c +0 -1
index f0d76113b001..321f9b82b73c 100644
@@ -7,7 +7,6 @@
 
 #define LOG_CATEGORY LOGC_EFI
 
-#include <common.h>
 #include <blk.h>
 #include <dm.h>
 #include <dm/device-internal.h>
lib/efi_loader/efi_dt_fixup.c +0 -1
index 838023c78ff7..2176388f4207 100644
@@ -5,7 +5,6 @@
  * Copyright (c) 2020 Heinrich Schuchardt
  */
 
-#include <common.h>
 #include <efi_dt_fixup.h>
 #include <efi_loader.h>
 #include <efi_rng.h>
lib/efi_loader/efi_esrt.c +0 -1
index 7f46d651e6f2..dafd447b6d76 100644
@@ -5,7 +5,6 @@
  *  Copyright (C) 2021 Arm Ltd.
  */
 
-#include <common.h>
 #include <efi_loader.h>
 #include <log.h>
 #include <efi_api.h>
lib/efi_loader/efi_file.c +0 -1
index 3c56cebf9653..222001d6a3b5 100644
@@ -5,7 +5,6 @@
  * Copyright (c) 2017 Rob Clark
  */
 
-#include <common.h>
 #include <charset.h>
 #include <efi_loader.h>
 #include <log.h>
lib/efi_loader/efi_firmware.c +0 -1
index 9abb29f1dff1..1fde1885e3ca 100644
@@ -6,7 +6,6 @@
  *                     Author: AKASHI Takahiro
  */
 
-#include <common.h>
 #include <charset.h>
 #include <dfu.h>
 #include <efi_loader.h>
lib/efi_loader/efi_freestanding.c +1 -1
index 4b65fc64dd04..b2786095c323 100644
@@ -8,7 +8,7 @@
  * memset(), and memcmp().
  */
 
-#include <common.h>
+#include <linux/types.h>
 
 /**
  * memcmp() - compare memory areas
lib/efi_loader/efi_gop.c +0 -1
index a09db31eb465..41e12fa72460 100644
@@ -5,7 +5,6 @@
  *  Copyright (c) 2016 Alexander Graf
  */
 
-#include <common.h>
 #include <dm.h>
 #include <efi_loader.h>
 #include <log.h>
lib/efi_loader/efi_helper.c +0 -1
index cdfd16ea7742..17f27ca1a0b2 100644
@@ -4,7 +4,6 @@
  */
 
 #define LOG_CATEGORY LOGC_EFI
-#include <common.h>
 #include <env.h>
 #include <malloc.h>
 #include <dm.h>
lib/efi_loader/efi_hii.c +0 -1
index 3b54ecb11ac1..74e402df1b8a 100644
@@ -6,7 +6,6 @@
  *  Copyright (c) 2018 AKASHI Takahiro, Linaro Limited
  */
 
-#include <common.h>
 #include <efi_loader.h>
 #include <malloc.h>
 #include <asm/unaligned.h>
lib/efi_loader/efi_hii_config.c +0 -1
index 31b0c97eb286..ae0f3ecd3b18 100644
@@ -10,7 +10,6 @@
  * the Makefile.
  */
 
-#include <common.h>
 #include <efi_loader.h>
 
 const efi_guid_t efi_guid_hii_config_routing_protocol
lib/efi_loader/efi_image_loader.c +0 -1
index 97547571ce33..604243603289 100644
@@ -9,7 +9,6 @@
 
 #define LOG_CATEGORY LOGC_EFI
 
-#include <common.h>
 #include <cpu_func.h>
 #include <efi_loader.h>
 #include <log.h>
lib/efi_loader/efi_load_initrd.c +0 -1
index 193433782c24..2b467b554810 100644
@@ -4,7 +4,6 @@
  */
 
 #define LOG_CATEGORY LOGC_EFI
-#include <common.h>
 #include <efi_loader.h>
 #include <efi_load_initrd.h>
 #include <efi_variable.h>
lib/efi_loader/efi_load_options.c +0 -1
index 5f62184da1cd..01984235e248 100644
@@ -7,7 +7,6 @@
 
 #define LOG_CATEGORY LOGC_EFI
 
-#include <common.h>
 #include <charset.h>
 #include <log.h>
 #include <malloc.h>
lib/efi_loader/efi_memory.c +0 -1
index f752703b438e..edfad2d95a1d 100644
@@ -7,7 +7,6 @@
 
 #define LOG_CATEGORY LOGC_EFI
 
-#include <common.h>
 #include <efi_loader.h>
 #include <init.h>
 #include <log.h>
lib/efi_loader/efi_net.c +0 -1
index 96a5bcca2758..7cd536705f43 100644
@@ -15,7 +15,6 @@
  * Reset():     EfiSimpleNetworkInitialized -> EfiSimpleNetworkInitialized
  */
 
-#include <common.h>
 #include <efi_loader.h>
 #include <malloc.h>
 #include <net.h>
lib/efi_loader/efi_riscv.c +0 -1
index 064172755b95..4d398c5be348 100644
@@ -7,7 +7,6 @@
  */
 
 #define LOG_CATEGORY LOGC_EFI
-#include <common.h>
 #include <efi_loader.h>
 #include <efi_variable.h>
 #include <log.h>
lib/efi_loader/efi_rng.c +0 -1
index bb11d8d0e0cb..9bad7ed69317 100644
@@ -5,7 +5,6 @@
 
 #define LOG_CATEGORY LOGC_EFI
 
-#include <common.h>
 #include <dm.h>
 #include <efi_loader.h>
 #include <efi_rng.h>
lib/efi_loader/efi_root_node.c +0 -1
index 108c14b95bd6..4d7fb74b5d6f 100644
@@ -5,7 +5,6 @@
  *  Copyright (c) 2018 Heinrich Schuchardt
  */
 
-#include <common.h>
 #include <malloc.h>
 #include <efi_dt_fixup.h>
 #include <efi_loader.h>
lib/efi_loader/efi_runtime.c +0 -1
index bf54d6ad871d..18da6892e796 100644
@@ -5,7 +5,6 @@
  *  Copyright (c) 2016 Alexander Graf
  */
 
-#include <common.h>
 #include <command.h>
 #include <cpu_func.h>
 #include <dm.h>
lib/efi_loader/efi_setup.c +0 -1
index e6de685e8795..36f66c51921b 100644
@@ -7,7 +7,6 @@
 
 #define LOG_CATEGORY LOGC_EFI
 
-#include <common.h>
 #include <efi_loader.h>
 #include <efi_variable.h>
 #include <log.h>
lib/efi_loader/efi_signature.c +0 -1
index 742d8919402c..f338e7327599 100644
@@ -4,7 +4,6 @@
  * Copyright (c) 2019 Linaro Limited, Author: AKASHI Takahiro
  */
 
-#include <common.h>
 #include <charset.h>
 #include <efi_loader.h>
 #include <efi_variable.h>
lib/efi_loader/efi_smbios.c +0 -1
index 48446f654d9b..2a79c0b1ba60 100644
@@ -7,7 +7,6 @@
 
 #define LOG_CATEGORY LOGC_EFI
 
-#include <common.h>
 #include <efi_loader.h>
 #include <log.h>
 #include <malloc.h>
lib/efi_loader/efi_string.c +0 -1
index e21e09c94617..413e329b600c 100644
@@ -5,7 +5,6 @@
  * Copyright (c) 2020 AKASHI Takahiro, Linaro Limited
  */
 
-#include <common.h>
 #include <charset.h>
 #include <efi_loader.h>
 #include <malloc.h>
lib/efi_loader/efi_tcg2.c +0 -1
index 463ea4c15416..8db35d0b3c85 100644
@@ -8,7 +8,6 @@
  */
 
 #define LOG_CATEGORY LOGC_EFI
-#include <common.h>
 #include <dm.h>
 #include <efi_loader.h>
 #include <efi_variable.h>
lib/efi_loader/efi_unicode_collation.c +0 -1
index c4c75720634a..2b6912c50921 100644
@@ -5,7 +5,6 @@
  * Copyright (c) 2018 Heinrich Schuchardt <[email protected]>
  */
 
-#include <common.h>
 #include <charset.h>
 #include <cp1250.h>
 #include <cp437.h>
lib/efi_loader/efi_var_common.c +0 -1
index ad50bffd2b26..d528747f3fb4 100644
@@ -6,7 +6,6 @@
  * Copyright (c) 2020 Linaro Limited, Author: AKASHI Takahiro
  */
 
-#include <common.h>
 #include <efi_loader.h>
 #include <efi_variable.h>
 #include <stdlib.h>
lib/efi_loader/efi_var_file.c +0 -1
index d7dba050710a..532b6b40eefe 100644
@@ -7,7 +7,6 @@
 
 #define LOG_CATEGORY LOGC_EFI
 
-#include <common.h>
 #include <charset.h>
 #include <fs.h>
 #include <log.h>
lib/efi_loader/efi_var_mem.c +0 -1
index 5fa7dcb8d3ed..6c21cec5d457 100644
@@ -5,7 +5,6 @@
  * Copyright (c) 2020, Heinrich Schuchardt
  */
 
-#include <common.h>
 #include <efi_loader.h>
 #include <efi_variable.h>
 #include <u-boot/crc.h>
lib/efi_loader/efi_variable.c +0 -1
index be95ed44e6ef..40f7a0fb10d5 100644
@@ -7,7 +7,6 @@
 
 #define LOG_CATEGORY LOGC_EFI
 
-#include <common.h>
 #include <efi_loader.h>
 #include <efi_variable.h>
 #include <env.h>
lib/efi_loader/efi_variable_tee.c +0 -1
index 09d03c0eee78..dde135fd9f81 100644
@@ -10,7 +10,6 @@
  *    Abdellatif El Khlifi <[email protected]>
  */
 
-#include <common.h>
 #if CONFIG_IS_ENABLED(ARM_FFA_TRANSPORT)
 #include <arm_ffa.h>
 #endif
lib/efi_loader/efi_watchdog.c +0 -1
index d741076dcdd9..f5fb9117717c 100644
@@ -5,7 +5,6 @@
  *  Copyright (c) 2017 Heinrich Schuchardt
  */
 
-#include <common.h>
 #include <efi_loader.h>
 
 /* Conversion factor from seconds to multiples of 100ns */
lib/efi_loader/initrddump.c +0 -2
index 5b470f481946..0004b6b042b4 100644
@@ -9,7 +9,6 @@
  * clearing of the screen.
  */
 
-#include <common.h>
 #include <efi_api.h>
 #include <efi_load_initrd.h>
 
--

2.34.1

author
#18 lore raw

PATCH 9/11 display_options: Clean up headers

In reply to Tom Rini

In include/display_options.h we cannot include ourself, but do need <linux/types.h> directly. Then in lib/display_options.c we further clean the list to remove common.h.

---
 include/display_options.h | 3 ++-
 lib/display_options.c     | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
include/display_options.h +2 -1
index 85dacbc75902..66e596077370 100644
@@ -9,6 +9,8 @@
 #ifndef __DISPLAY_OPTIONS_H
 #define __DISPLAY_OPTIONS_H
 
+#include <linux/types.h>
+
 /**
  * print_size() - Print a size with a suffix
  *
@@ -19,7 +21,6 @@
  * @size:	Size to print
  * @suffix	String to print after the size
  */
-#include <display_options.h>
 void print_size(uint64_t size, const char *suffix);
 
 /**
lib/display_options.c +2 -1
index 80def5201f96..d6b93553dcb5 100644
@@ -4,14 +4,15 @@
  * Wolfgang Denk, DENX Software Engineering, [email protected].
  */
 
-#include <common.h>
 #include <compiler.h>
 #include <console.h>
 #include <display_options.h>
 #include <div64.h>
 #include <version_string.h>
 #include <linux/ctype.h>
+#include <linux/kernel.h>
 #include <asm/io.h>
+#include <vsprintf.h>
 
 char *display_options_get_banner_priv(bool newlines, const char *build_tag,
 				      char *buf, int size)
Signature · 1 line
2.34.1
Reviewed-by on v1 9/11
#19 lore raw

Re: [PATCH 09/11] display_options: Clean up headers

Quoted 10 lines · Tom Rini

In include/display_options.h we cannot include ourself, but do need <linux/types.h> directly. Then in lib/display_options.c we further clean the list to remove common.h.

---
 include/display_options.h | 3 ++-
 lib/display_options.c     | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
author
#20 lore raw

PATCH 10/11 include: Further cleanup includes

In reply to Tom Rini

Add some missing headers such as <linux/errno.h> or <linux/types.h> or <linux/kernel.h> to header files that make direct usage of things provided by these headers.

---
 include/atmel_lcd.h | 2 ++
 include/getopt.h    | 2 ++
 include/mapmem.h    | 2 ++
 include/memalign.h  | 1 +
 include/net6.h      | 1 +
 include/rtc.h       | 1 +
 6 files changed, 9 insertions(+)
include/atmel_lcd.h +2 -0
index 66436b9b2772..a115d6c17014 100644
@@ -9,6 +9,8 @@
 #ifndef _ATMEL_LCD_H_
 #define _ATMEL_LCD_H_
 
+#include <linux/types.h>
+
 /**
  * struct atmel_lcd_plat - platform data for Atmel LCDs with driver model
  *
include/getopt.h +2 -0
index 6f5811e64be9..8645082da2a7 100644
@@ -9,6 +9,8 @@
 #ifndef __GETOPT_H
 #define __GETOPT_H
 
+#include <stdbool.h>
+
 /**
  * struct getopt_state - Saved state across getopt() calls
  */
include/mapmem.h +2 -0
index 2134c8004d94..bb68b4c11afd 100644
@@ -13,6 +13,8 @@
 # ifdef CONFIG_ARCH_MAP_SYSMEM
 #include <asm/io.h>
 # else
+#include <linux/types.h>
+
 static inline void *map_sysmem(phys_addr_t paddr, unsigned long len)
 {
 	return (void *)(uintptr_t)paddr;
include/memalign.h +1 -0
index f67f0a74f2e8..eaa9f6b5cbd6 100644
@@ -11,6 +11,7 @@
  * is used to align DMA buffers.
  */
 #ifndef __ASSEMBLY__
+#include <linux/kernel.h>
 #include <asm/cache.h>
 #include <malloc.h>
 
include/net6.h +1 -0
index 1e766aa72092..1ed989e584ae 100644
@@ -12,6 +12,7 @@
 
 #include <net.h>
 #include <linux/ctype.h>
+#include <linux/errno.h>
 
 /* struct in6_addr - 128 bits long IPv6 address */
 struct in6_addr {
include/rtc.h +1 -0
index b6fdbb60dc2b..22f6d3705917 100644
@@ -16,6 +16,7 @@
 #include <bcd.h>
 #include <rtc_def.h>
 #include <linux/errno.h>
+#include <linux/types.h>
 
 typedef int64_t time64_t;
 struct udevice;
Signature · 1 line
2.34.1
Reviewed-by on v1 10/11
#21 lore raw

Re: [PATCH 10/11] include: Further cleanup includes

Quoted 6 lines · Tom Rini

Add some missing headers such as <linux/errno.h> or <linux/types.h> or <linux/kernel.h> to header files that make direct usage of things provided by these headers.

Quoted 8 lines
---
 include/atmel_lcd.h | 2 ++
 include/getopt.h    | 2 ++
 include/mapmem.h    | 2 ++
 include/memalign.h  | 1 +
 include/net6.h      | 1 +
 include/rtc.h       | 1 +
 6 files changed, 9 insertions(+)
author
#22 lore raw

PATCH 11/11 lib: Remove <common.h> inclusion from these files

In reply to Tom Rini

After some header file cleanups to add missing include files, remove common.h from all files in the lib directory. This primarily means just dropping the line but in a few cases we need to add in other header files now.

---
 lib/abuf.c                                        | 1 -
 lib/acpi/acpi.c                                   | 1 -
 lib/acpi/acpi_device.c                            | 1 -
 lib/acpi/acpi_dp.c                                | 1 -
 lib/acpi/acpi_table.c                             | 1 -
 lib/acpi/acpi_writer.c                            | 2 +-
 lib/acpi/acpigen.c                                | 1 -
 lib/acpi/base.c                                   | 3 ++-
 lib/acpi/csrt.c                                   | 2 +-
 lib/acpi/dsdt.c                                   | 2 +-
 lib/acpi/facs.c                                   | 2 +-
 lib/acpi/mcfg.c                                   | 4 +++-
 lib/acpi/ssdt.c                                   | 3 ++-
 lib/addr_map.c                                    | 1 -
 lib/aes.c                                         | 2 +-
 lib/aes/aes-decrypt.c                             | 1 -
 lib/asm-offsets.c                                 | 2 +-
 lib/at91/at91.c                                   | 1 -
 lib/bch.c                                         | 1 -
 lib/binman.c                                      | 1 -
 lib/bzip2/bzlib.c                                 | 3 +--
 lib/bzip2/bzlib_decompress.c                      | 1 -
 lib/charset.c                                     | 1 -
 lib/circbuf.c                                     | 1 -
 lib/crc16-ccitt.c                                 | 2 --
 lib/crc32.c                                       | 1 -
 lib/crc32c.c                                      | 1 -
 lib/crc8.c                                        | 2 --
 lib/crypt/crypt-port.h                            | 3 +++
 lib/crypt/crypt.c                                 | 1 -
 lib/crypto/x509_public_key.c                      | 1 -
 lib/date.c                                        | 1 -
 lib/dhry/cmd_dhry.c                               | 3 ++-
 lib/dhry/dhry_1.c                                 | 2 +-
 lib/dhry/dhry_2.c                                 | 2 +-
 lib/efi/efi.c                                     | 1 -
 lib/efi/efi_app.c                                 | 1 -
 lib/efi/efi_info.c                                | 1 -
 lib/efi/efi_stub.c                                | 1 -
 lib/efi_driver/efi_block_device.c                 | 1 -
 lib/efi_driver/efi_uclass.c                       | 1 -
 lib/efi_selftest/efi_selftest_esrt.c              | 1 -
 lib/efi_selftest/efi_selftest_miniapp_exception.c | 1 -
 lib/efi_selftest/efi_selftest_miniapp_exit.c      | 1 -
 lib/efi_selftest/efi_selftest_miniapp_return.c    | 1 -
 lib/elf.c                                         | 1 -
 lib/errno_str.c                                   | 2 +-
 lib/fdtdec.c                                      | 1 -
 lib/fdtdec_common.c                               | 1 -
 lib/fdtdec_test.c                                 | 1 -
 lib/getopt.c                                      | 2 +-
 lib/gunzip.c                                      | 1 -
 lib/gzip.c                                        | 1 -
 lib/hang.c                                        | 2 +-
 lib/hash-checksum.c                               | 1 -
 lib/hashtable.c                                   | 1 -
 lib/hexdump.c                                     | 2 +-
 lib/image-sparse.c                                | 1 -
 lib/initcall.c                                    | 1 -
 lib/linux_compat.c                                | 1 -
 lib/list_sort.c                                   | 1 -
 lib/lmb.c                                         | 1 -
 lib/lz4.c                                         | 1 -
 lib/lz4_wrapper.c                                 | 1 -
 lib/lzma/LzmaDec.c                                | 1 -
 lib/lzma/LzmaTools.c                              | 1 -
 lib/lzo/lzo1x_decompress.c                        | 3 ++-
 lib/md5.c                                         | 1 -
 lib/membuff.c                                     | 1 -
 lib/net_utils.c                                   | 2 +-
 lib/of_live.c                                     | 1 -
 lib/optee/optee.c                                 | 1 -
 lib/panic.c                                       | 1 -
 lib/physmem.c                                     | 2 +-
 lib/qsort.c                                       | 1 -
 lib/rand.c                                        | 1 -
 lib/rc4.c                                         | 3 ---
 lib/rsa/rsa-keyprop.c                             | 1 -
 lib/rsa/rsa-mod-exp.c                             | 1 -
 lib/rsa/rsa-verify.c                              | 1 -
 lib/rtc-lib.c                                     | 1 -
 lib/semihosting.c                                 | 3 ++-
 lib/slre.c                                        | 2 +-
 lib/smbios-parser.c                               | 1 -
 lib/smbios.c                                      | 1 -
 lib/strto.c                                       | 2 +-
 lib/tables_csum.c                                 | 3 +--
 lib/time.c                                        | 1 -
 lib/tiny-printf.c                                 | 1 -
 lib/tpm-common.c                                  | 1 -
 lib/tpm-v1.c                                      | 1 -
 lib/tpm-v2.c                                      | 1 -
 lib/tpm_api.c                                     | 1 -
 lib/trace.c                                       | 2 +-
 lib/uuid.c                                        | 2 --
 lib/vsprintf.c                                    | 1 -
 lib/zstd/zstd.c                                   | 2 +-
 97 files changed, 36 insertions(+), 103 deletions(-)
lib/abuf.c +0 -1
index ce2cff53dc93..937c3df351e9 100644
@@ -7,7 +7,6 @@
  */
 
 #ifndef USE_HOSTCC
-#include <common.h>
 #include <malloc.h>
 #include <mapmem.h>
 #include <string.h>
lib/acpi/acpi.c +0 -1
index 14b15754f492..40a8ccc0a2df 100644
@@ -5,7 +5,6 @@
  * Copyright 2023 Google LLC
  */
 
-#include <common.h>
 #include <mapmem.h>
 #include <acpi/acpi_table.h>
 #include <asm/global_data.h>
lib/acpi/acpi_device.c +0 -1
index 1b838fdbd6f0..ed94194346d5 100644
@@ -6,7 +6,6 @@
  * Mostly taken from coreboot file of the same name
  */
 
-#include <common.h>
 #include <dm.h>
 #include <irq.h>
 #include <log.h>
lib/acpi/acpi_dp.c +0 -1
index 7e3e3259d8d4..6733809986ae 100644
@@ -6,7 +6,6 @@
  * Mostly taken from coreboot file acpi_device.c
  */
 
-#include <common.h>
 #include <dm.h>
 #include <log.h>
 #include <malloc.h>
lib/acpi/acpi_table.c +0 -1
index a8d4b470001d..e74522e9972e 100644
@@ -5,7 +5,6 @@
  * Copyright 2019 Google LLC
  */
 
-#include <common.h>
 #include <dm.h>
 #include <cpu.h>
 #include <log.h>
lib/acpi/acpi_writer.c +1 -1
index 946f90e8e7b1..a8dc207557b4 100644
@@ -7,13 +7,13 @@
 
 #define LOG_CATEGORY LOGC_ACPI
 
-#include <common.h>
 #include <log.h>
 #include <malloc.h>
 #include <mapmem.h>
 #include <acpi/acpi_table.h>
 #include <asm/global_data.h>
 #include <dm/acpi.h>
+#include <linux/errno.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
lib/acpi/acpigen.c +0 -1
index e395226e3de3..b95cabb91493 100644
@@ -8,7 +8,6 @@
 
 #define LOG_CATEGORY LOGC_ACPI
 
-#include <common.h>
 #include <dm.h>
 #include <log.h>
 #include <uuid.h>
lib/acpi/base.c +2 -1
index 2057bd2bef88..63758c99b15e 100644
@@ -7,11 +7,12 @@
 
 #define LOG_CATEGORY LOGC_ACPI
 
-#include <common.h>
 #include <acpi/acpi_table.h>
 #include <dm/acpi.h>
 #include <mapmem.h>
 #include <tables_csum.h>
+#include <linux/errno.h>
+#include <linux/string.h>
 
 void acpi_write_rsdp(struct acpi_rsdp *rsdp, struct acpi_rsdt *rsdt,
 		     struct acpi_xsdt *xsdt)
lib/acpi/csrt.c +1 -1
index 2ba86f229529..00927e534063 100644
@@ -7,11 +7,11 @@
 
 #define LOG_CATEGORY LOGC_ACPI
 
-#include <common.h>
 #include <mapmem.h>
 #include <tables_csum.h>
 #include <acpi/acpi_table.h>
 #include <dm/acpi.h>
+#include <linux/string.h>
 
 __weak int acpi_fill_csrt(struct acpi_ctx *ctx)
 {
lib/acpi/dsdt.c +1 -1
index db98cc20e1d0..206e1e2678ff 100644
@@ -7,10 +7,10 @@
 
 #define LOG_CATEGORY LOGC_ACPI
 
-#include <common.h>
 #include <acpi/acpi_table.h>
 #include <dm/acpi.h>
 #include <tables_csum.h>
+#include <linux/string.h>
 
 /*
  * IASL compiles the dsdt entries and writes the hex values
lib/acpi/facs.c +1 -1
index e89f43ca5c91..86c28120c7e3 100644
@@ -7,9 +7,9 @@
 
 #define LOG_CATEGORY LOGC_ACPI
 
-#include <common.h>
 #include <acpi/acpi_table.h>
 #include <dm/acpi.h>
+#include <linux/string.h>
 
 int acpi_write_facs(struct acpi_ctx *ctx, const struct acpi_writer *entry)
 {
lib/acpi/mcfg.c +3 -1
index 7404ae586ab7..8b8a5bfafae2 100644
@@ -7,11 +7,13 @@
 
 #define LOG_CATEGORY LOGC_ACPI
 
-#include <common.h>
 #include <mapmem.h>
 #include <tables_csum.h>
 #include <acpi/acpi_table.h>
 #include <dm/acpi.h>
+#include <linux/errno.h>
+#include <linux/string.h>
+#include <linux/types.h>
 
 int acpi_create_mcfg_mmconfig(struct acpi_mcfg_mmconfig *mmconfig, u32 base,
 			      u16 seg_nr, u8 start, u8 end)
lib/acpi/ssdt.c +2 -1
index 659c1aad406b..4c7a715f75db 100644
@@ -7,10 +7,11 @@
 
 #define LOG_CATEGORY LOGC_ACPI
 
-#include <common.h>
 #include <acpi/acpi_table.h>
 #include <dm/acpi.h>
 #include <tables_csum.h>
+#include <linux/errno.h>
+#include <linux/string.h>
 
 int acpi_write_ssdt(struct acpi_ctx *ctx, const struct acpi_writer *entry)
 {
lib/addr_map.c +0 -1
index 86e932e4b561..f85fb0c7fb1b 100644
@@ -3,7 +3,6 @@
  * Copyright 2008 Freescale Semiconductor, Inc.
  */
 
-#include <common.h>
 #include <addr_map.h>
 #include <mapmem.h>
 
lib/aes.c +1 -1
index 4fca85ebee26..39ad4a990f07 100644
@@ -22,9 +22,9 @@
 */
 
 #ifndef USE_HOSTCC
-#include <common.h>
 #include <display_options.h>
 #include <log.h>
+#include <linux/string.h>
 #else
 #include <string.h>
 #endif
lib/aes/aes-decrypt.c +0 -1
index 345029fa7847..741102a4723b 100644
@@ -4,7 +4,6 @@
  */
 
 #ifndef USE_HOSTCC
-#include <common.h>
 #include <malloc.h>
 #endif
 #include <image.h>
lib/asm-offsets.c +1 -1
index 216d9716d0d6..4e2dbda9a710 100644
@@ -11,9 +11,9 @@
  * #defines from the assembly-language output.
  */
 
-#include <common.h>
 #include <asm-offsets.h>
 #include <asm/global_data.h>
+#include <asm/u-boot.h>
 
 #include <linux/kbuild.h>
 
lib/at91/at91.c +0 -1
index 048597690b1d..bd31e9e41dc1 100644
@@ -4,7 +4,6 @@
  *		 Wenyou.Yang <[email protected]>
  */
 
-#include <common.h>
 #include <atmel_lcd.h>
 
 #include "atmel_logo_8bpp.h"
lib/bch.c +0 -1
index 72b4fdcc9c44..a309a8dfcba4 100644
@@ -54,7 +54,6 @@
  */
 
 #ifndef USE_HOSTCC
-#include <common.h>
 #include <log.h>
 #include <malloc.h>
 #include <ubi_uboot.h>
lib/binman.c +0 -1
index cfe1e5f80710..9047f5275f32 100644
@@ -6,7 +6,6 @@
  * Written by Simon Glass <[email protected]>
  */
 
-#include <common.h>
 #include <binman.h>
 #include <dm.h>
 #include <log.h>
lib/bzip2/bzlib.c +1 -2
index bd589aa810c1..f7318b7886e0 100644
@@ -1,7 +1,6 @@
-#include <config.h>
-#include <common.h>
 #include <malloc.h>
 #include <watchdog.h>
+#include <stdio.h>
 
 /*
  * This file is a modified version of bzlib.c from the bzip2-1.0.2
lib/bzip2/bzlib_decompress.c +0 -1
index 3b417d57b276..e56ab6674b05 100644
@@ -1,5 +1,4 @@
 #include <config.h>
-#include <common.h>
 #include <watchdog.h>
 
 /*-------------------------------------------------------------*/
lib/charset.c +0 -1
index 5e4c4f948a4a..89057ef7ce22 100644
@@ -5,7 +5,6 @@
  *  Copyright (c) 2017 Rob Clark
  */
 
-#include <common.h>
 #include <charset.h>
 #include <capitalization.h>
 #include <cp437.h>
lib/circbuf.c +0 -1
index fa79c148dae4..2e161ae8d8ba 100644
@@ -4,7 +4,6 @@
  * Gerry Hamel, [email protected], Texas Instruments
  */
 
-#include <common.h>
 #include <log.h>
 #include <malloc.h>
 
lib/crc16-ccitt.c +0 -2
index 6cadbc103d3e..6fa4e93ed17c 100644
@@ -24,8 +24,6 @@
 
 #ifdef USE_HOSTCC
 #include <arpa/inet.h>
-#else
-#include <common.h>
 #endif
 #include <u-boot/crc.h>
 
lib/crc32.c +0 -1
index f6fad8c15dfc..f36f1763064f 100644
@@ -11,7 +11,6 @@
 #ifdef USE_HOSTCC
 #include <arpa/inet.h>
 #else
-#include <common.h>
 #include <efi_loader.h>
 #endif
 #include <compiler.h>
lib/crc32c.c +0 -1
index 016b34a523b8..7026ac4c330e 100644
@@ -10,7 +10,6 @@
  * any later version.
  */
 
-#include <common.h>
 #include <compiler.h>
 
 uint32_t crc32c_cal(uint32_t crc, const char *data, int length,
lib/crc8.c +0 -2
index 87b87b675b27..20d46d161472 100644
@@ -5,8 +5,6 @@
 
 #ifdef USE_HOSTCC
 #include <arpa/inet.h>
-#else
-#include <common.h>
 #endif
 #include <u-boot/crc.h>
 
lib/crypt/crypt-port.h +3 -0
index 6b9542d75bc2..50dde68b5cde 100644
@@ -1,6 +1,9 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /* Copyright (C) 2020 Steffen Jaeckel <[email protected]> */
 
+#include <linux/errno.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
 #include <linux/types.h>
 #include <vsprintf.h>
 
lib/crypt/crypt.c +0 -1
index 247c34b2a9c3..8f5fadb582ed 100644
@@ -1,7 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0+
 /* Copyright (C) 2020 Steffen Jaeckel <[email protected]> */
 
-#include <common.h>
 #include <crypt.h>
 #include "crypt-port.h"
 
lib/crypto/x509_public_key.c +0 -1
index 30071233ee79..a10145a7cdcf 100644
@@ -7,7 +7,6 @@
 
 #define pr_fmt(fmt) "X.509: "fmt
 #ifdef __UBOOT__
-#include <common.h>
 #include <image.h>
 #include <dm/devres.h>
 #include <linux/compat.h>
lib/date.c +0 -1
index e3d22459cd05..0deac8a1bee1 100644
@@ -4,7 +4,6 @@
  * Wolfgang Denk, DENX Software Engineering, [email protected].
  */
 
-#include <common.h>
 #include <command.h>
 #include <errno.h>
 #include <rtc.h>
lib/dhry/cmd_dhry.c +2 -1
index 77b52a23003c..e52beaeaadc7 100644
@@ -3,9 +3,10 @@
  * (C) Copyright 2015 Google, Inc
  */
 
-#include <common.h>
 #include <command.h>
 #include <div64.h>
+#include <time.h>
+#include <vsprintf.h>
 #include "dhry.h"
 
 static int do_dhry(struct cmd_tbl *cmdtp, int flag, int argc,
lib/dhry/dhry_1.c +1 -1
index dcc224fb387d..252cd14a656e 100644
@@ -42,8 +42,8 @@
  ***************************************************************************/
 char SCCSid[] = "@(#) @(#)dhry_1.c:3.4 -- 5/15/91 19:30:21";
 
-#include <common.h>
 #include <malloc.h>
+#include <stdio.h>
 
 #include "dhry.h"
 
lib/dhry/dhry_2.c +1 -1
index 1ba879673e30..a74197d884de 100644
@@ -39,7 +39,7 @@
  ****************************************************************************/
 /* SCCSid is defined in dhry_1.c */
 
-#include <common.h>
+#include <linux/string.h>
 #include "dhry.h"
 
 #ifndef REG
lib/efi/efi.c +0 -1
index aa42f1842f33..bcb34d67465d 100644
@@ -10,7 +10,6 @@
  * Common EFI functions
  */
 
-#include <common.h>
 #include <debug_uart.h>
 #include <errno.h>
 #include <malloc.h>
lib/efi/efi_app.c +0 -1
index 2209410f35b5..a5ffa53b5a4e 100644
@@ -8,7 +8,6 @@
  * This file implements U-Boot running as an EFI application.
  */
 
-#include <common.h>
 #include <cpu_func.h>
 #include <debug_uart.h>
 #include <dm.h>
lib/efi/efi_info.c +0 -1
index 4d78923c4d40..5b564c5651d5 100644
@@ -5,7 +5,6 @@
  * Access to the EFI information table
  */
 
-#include <common.h>
 #include <efi.h>
 #include <errno.h>
 #include <mapmem.h>
lib/efi/efi_stub.c +0 -1
index c9eb32ec1046..40fc29d9adf7 100644
@@ -9,7 +9,6 @@
  * EFI application. It can be built either in 32-bit or 64-bit mode.
  */
 
-#include <common.h>
 #include <debug_uart.h>
 #include <efi.h>
 #include <efi_api.h>
lib/efi_driver/efi_block_device.c +0 -1
index e3abd90275c8..34a0365739d7 100644
@@ -28,7 +28,6 @@
  * iPXE uses the simple file protocol to load Grub or the Linux Kernel.
  */
 
-#include <common.h>
 #include <blk.h>
 #include <dm.h>
 #include <efi_driver.h>
lib/efi_driver/efi_uclass.c +0 -1
index 66a45e156d60..e1e28df20b2c 100644
@@ -17,7 +17,6 @@
  * controllers.
  */
 
-#include <common.h>
 #include <dm.h>
 #include <efi_driver.h>
 #include <log.h>
lib/efi_selftest/efi_selftest_esrt.c +0 -1
index 922ff253c72c..b7688deb4964 100644
@@ -4,7 +4,6 @@
  *
  *  Copyright (C) 2021 Arm Ltd.
  */
-#include <common.h>
 #include <efi_loader.h>
 #include <efi_selftest.h>
 
lib/efi_selftest/efi_selftest_miniapp_exception.c +0 -1
index a9ad381001f9..f668cdac4ab2 100644
@@ -7,7 +7,6 @@
  * This EFI application triggers an exception.
  */
 
-#include <common.h>
 #include <efi_api.h>
 #include <host_arch.h>
 
lib/efi_selftest/efi_selftest_miniapp_exit.c +0 -1
index 1c42d6dd400f..8b2e60cc7114 100644
@@ -8,7 +8,6 @@
  * It uses the Exit boot service to return.
  */
 
-#include <common.h>
 #include <efi_selftest.h>
 
 static efi_guid_t loaded_image_protocol_guid = EFI_LOADED_IMAGE_PROTOCOL_GUID;
lib/efi_selftest/efi_selftest_miniapp_return.c +0 -1
index 45366aa9c638..8792d78ab30f 100644
@@ -8,7 +8,6 @@
  * It returns directly without calling the Exit boot service.
  */
 
-#include <common.h>
 #include <efi_api.h>
 
 /*
lib/elf.c +0 -1
index 0476b2614c33..9a794f9cba89 100644
@@ -3,7 +3,6 @@
    Copyright (c) 2001 William L. Pitts
 */
 
-#include <common.h>
 #include <command.h>
 #include <cpu_func.h>
 #include <elf.h>
lib/errno_str.c +1 -1
index 2e5f4a887d5b..752d4eb47aa6 100644
@@ -4,8 +4,8 @@
  *
  * SDPX-License-Identifier:	GPL-2.0+
  */
-#include <common.h>
 #include <errno.h>
+#include <linux/kernel.h>
 
 #define ERRNO_MSG(errno, msg)	msg
 #define SAME_AS(x)		(const char *)&errno_message[x]
lib/fdtdec.c +0 -1
index 7a6916764835..4016bf3c1130 100644
@@ -7,7 +7,6 @@
  */
 
 #ifndef USE_HOSTCC
-#include <common.h>
 #include <boot_fit.h>
 #include <display_options.h>
 #include <dm.h>
lib/fdtdec_common.c +0 -1
index ddaca0087e19..ca36ff15952b 100644
@@ -8,7 +8,6 @@
  */
 
 #ifndef USE_HOSTCC
-#include <common.h>
 #include <log.h>
 #include <linux/libfdt.h>
 #include <fdtdec.h>
lib/fdtdec_test.c +0 -1
index 85351c75ca29..1e4d5fc83264 100644
@@ -6,7 +6,6 @@
  * Copyright (c) 2011 The Chromium OS Authors.
  */
 
-#include <common.h>
 #include <command.h>
 #include <fdtdec.h>
 #include <linux/libfdt.h>
lib/getopt.c +1 -1
index 8b4515dc1967..e9175e2fff49 100644
@@ -8,9 +8,9 @@
 
 #define LOG_CATEGORY LOGC_CORE
 
-#include <common.h>
 #include <getopt.h>
 #include <log.h>
+#include <linux/string.h>
 
 void getopt_init_state(struct getopt_state *gs)
 {
lib/gunzip.c +0 -1
index 932e3e8036d1..e71d8d00ccb5 100644
@@ -4,7 +4,6 @@
  * Wolfgang Denk, DENX Software Engineering, [email protected].
  */
 
-#include <common.h>
 #include <blk.h>
 #include <command.h>
 #include <console.h>
lib/gzip.c +0 -1
index 2595b2d04b42..5d9c19598d5e 100644
@@ -4,7 +4,6 @@
  * Lei Wen <[email protected]>, Marvell Inc.
  */
 
-#include <common.h>
 #include <watchdog.h>
 #include <command.h>
 #include <gzip.h>
lib/hang.c +1 -1
index 2735774f9a40..3cfb06e9ca8d 100644
@@ -7,9 +7,9 @@
  * u-boot.
  */
 
-#include <common.h>
 #include <bootstage.h>
 #include <hang.h>
+#include <stdio.h>
 #include <os.h>
 
 /**
lib/hash-checksum.c +0 -1
index 68c290d64d86..1970a741294d 100644
@@ -4,7 +4,6 @@
  */
 
 #ifndef USE_HOSTCC
-#include <common.h>
 #include <fdtdec.h>
 #include <asm/byteorder.h>
 #include <linux/errno.h>
lib/hashtable.c +0 -1
index f2d36bd34b4c..a0060f6a0d63 100644
@@ -30,7 +30,6 @@
 #  endif
 # endif
 #else				/* U-Boot build */
-# include <common.h>
 # include <linux/string.h>
 # include <linux/ctype.h>
 #endif
lib/hexdump.c +1 -1
index 149c93ead8b8..33e3e6e51824 100644
@@ -8,9 +8,9 @@
  * more details.
  */
 
-#include <common.h>
 #include <hexdump.h>
 #include <mapmem.h>
+#include <vsprintf.h>
 #include <linux/ctype.h>
 #include <linux/compat.h>
 #include <linux/log2.h>
lib/image-sparse.c +0 -1
index 323aad981c64..f82890646920 100644
@@ -35,7 +35,6 @@
  */
 
 #include <config.h>
-#include <common.h>
 #include <blk.h>
 #include <image-sparse.h>
 #include <div64.h>
lib/initcall.c +0 -1
index 33b7d761dc7e..ce317af213ab 100644
@@ -3,7 +3,6 @@
  * Copyright (c) 2013 The Chromium OS Authors.
  */
 
-#include <common.h>
 #include <efi.h>
 #include <initcall.h>
 #include <log.h>
lib/linux_compat.c +0 -1
index c83426f59dc2..985e88eb3976 100644
@@ -1,5 +1,4 @@
 
-#include <common.h>
 #include <malloc.h>
 #include <memalign.h>
 #include <asm/cache.h>
lib/list_sort.c +0 -1
index 1c9e06173270..a6e54d5bc46e 100644
@@ -6,7 +6,6 @@
 #include <linux/slab.h>
 #else
 #include <linux/compat.h>
-#include <common.h>
 #include <malloc.h>
 #include <linux/printk.h>
 #endif
lib/lmb.c +0 -1
index da924c6789ac..44f982053101 100644
@@ -6,7 +6,6 @@
  * Copyright (C) 2001 Peter Bergner.
  */
 
-#include <common.h>
 #include <efi_loader.h>
 #include <image.h>
 #include <mapmem.h>
lib/lz4.c +0 -1
index 5337842126c8..d365dc727cfd 100644
@@ -27,7 +27,6 @@
  *	- LZ4 homepage : http://www.lz4.org
  *	- LZ4 source repository : https://github.com/lz4/lz4
  */
-#include <common.h>
 #include <compiler.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
lib/lz4_wrapper.c +0 -1
index 67dea2ff3904..4d48e7b0e8bf 100644
@@ -3,7 +3,6 @@
  * Copyright 2015 Google Inc.
  */
 
-#include <common.h>
 #include <compiler.h>
 #include <image.h>
 #include <linux/kernel.h>
lib/lzma/LzmaDec.c +0 -1
index a90b35c6a993..1da3f0a14a7d 100644
@@ -2,7 +2,6 @@
 2009-09-20 : Igor Pavlov : Public domain */
 
 #include <config.h>
-#include <common.h>
 #include <watchdog.h>
 #include "LzmaDec.h"
 
lib/lzma/LzmaTools.c +0 -1
index 55f64cd28908..400d606784ea 100644
@@ -18,7 +18,6 @@
  */
 
 #include <config.h>
-#include <common.h>
 #include <log.h>
 #include <watchdog.h>
 
lib/lzo/lzo1x_decompress.c +2 -1
index 65fef0b0eb90..5d70fa413379 100644
@@ -11,8 +11,9 @@
  *  Richard Purdie <[email protected]>
  */
 
-#include <common.h>
+#include <linux/kernel.h>
 #include <linux/lzo.h>
+#include <linux/string.h>
 #include <asm/byteorder.h>
 #include <asm/unaligned.h>
 #include "lzodefs.h"
lib/md5.c +0 -1
index 1636ab936619..faf3f78ab1ed 100644
@@ -28,7 +28,6 @@
 #include "compiler.h"
 
 #ifndef USE_HOSTCC
-#include <common.h>
 #include <watchdog.h>
 #endif /* USE_HOSTCC */
 #include <u-boot/md5.h>
lib/membuff.c +0 -1
index 36dc43a523fb..3c6c0ae125c4 100644
@@ -6,7 +6,6 @@
  * Copyright (c) 1992 Simon Glass
  */
 
-#include <common.h>
 #include <errno.h>
 #include <log.h>
 #include <malloc.h>
lib/net_utils.c +1 -1
index 4283c13a31d9..c70fef0d991b 100644
@@ -9,9 +9,9 @@
  * Copyright 2009 Dirk Behme, [email protected]
  */
 
-#include <common.h>
 #include <net.h>
 #include <net6.h>
+#include <vsprintf.h>
 
 struct in_addr string_to_ip(const char *s)
 {
lib/of_live.c +0 -1
index 812c488f6067..90b9459ede31 100644
@@ -10,7 +10,6 @@
 
 #define LOG_CATEGORY	LOGC_DT
 
-#include <common.h>
 #include <abuf.h>
 #include <log.h>
 #include <linux/libfdt.h>
lib/optee/optee.c +0 -1
index b03622404469..393f2715a9c1 100644
@@ -4,7 +4,6 @@
  * Bryan O'Donoghue <[email protected]>
  */
 
-#include <common.h>
 #include <fdtdec.h>
 #include <image.h>
 #include <log.h>
lib/panic.c +0 -1
index 66ae17f3df99..0f578b5b5131 100644
@@ -9,7 +9,6 @@
  * Wirzenius wrote this portably, Torvalds fucked it up :-)
  */
 
-#include <common.h>
 #include <hang.h>
 #if !defined(CONFIG_PANIC_HANG)
 #include <command.h>
lib/physmem.c +1 -1
index fc90ce4d7cfd..562c74d37f31 100644
@@ -8,11 +8,11 @@
  * Software Foundation.
  */
 
-#include <common.h>
 #include <log.h>
 #include <mapmem.h>
 #include <physmem.h>
 #include <linux/compiler.h>
+#include <linux/string.h>
 
 phys_addr_t __weak arch_phys_memset(phys_addr_t s, int c, phys_size_t n)
 {
lib/qsort.c +0 -1
index 2f18588dfccd..a2562c4942ea 100644
@@ -17,7 +17,6 @@
 
 #include <log.h>
 #include <linux/types.h>
-#include <common.h>
 #include <exports.h>
 #include <sort.h>
 
lib/rand.c +0 -1
index d256baf5cee7..d6f2977e8dcc 100644
@@ -7,7 +7,6 @@
  * Michael Walle <[email protected]>
  */
 
-#include <common.h>
 #include <rand.h>
 
 static unsigned int y = 1U;
lib/rc4.c +0 -3
index 720112d1fd8e..3839924a2b2c 100644
@@ -7,9 +7,6 @@
  * Rivest Cipher 4 (RC4) implementation
  */
 
-#ifndef USE_HOSTCC
-#include <common.h>
-#endif
 #include <rc4.h>
 
 void rc4_encode(unsigned char *buf, unsigned int len, const unsigned char key[16])
lib/rsa/rsa-keyprop.c +0 -1
index 98855f67b890..80d0594a4303 100644
@@ -9,7 +9,6 @@
  * Copyright (c) 2016 Thomas Pornin <[email protected]>
  */
 
-#include <common.h>
 #include <image.h>
 #include <malloc.h>
 #include <crypto/internal/rsa.h>
lib/rsa/rsa-mod-exp.c +0 -1
index d259b2aedf27..5b3ea02f82f8 100644
@@ -4,7 +4,6 @@
  */
 
 #ifndef USE_HOSTCC
-#include <common.h>
 #include <fdtdec.h>
 #include <log.h>
 #include <asm/types.h>
lib/rsa/rsa-verify.c +0 -1
index 2f3b34403913..e194e5433138 100644
@@ -4,7 +4,6 @@
  */
 
 #ifndef USE_HOSTCC
-#include <common.h>
 #include <fdtdec.h>
 #include <log.h>
 #include <malloc.h>
lib/rtc-lib.c +0 -1
index 1f7bdade298a..46dcfba27157 100644
@@ -10,7 +10,6 @@
  * - January is month 1.
  */
 
-#include <common.h>
 #include <rtc.h>
 #include <linux/math64.h>
 
lib/semihosting.c +2 -1
index 831774e35664..9be5bffd3012 100644
@@ -4,9 +4,10 @@
  * Copyright 2014 Broadcom Corporation
  */
 
-#include <common.h>
 #include <log.h>
 #include <semihosting.h>
+#include <linux/errno.h>
+#include <linux/string.h>
 
 #define SYSOPEN		0x01
 #define SYSCLOSE	0x02
lib/slre.c +1 -1
index e82a9e7635b1..7d5ed905e4bf 100644
@@ -21,8 +21,8 @@
 #include <string.h>
 #else
 #include <log.h>
-#include <common.h>
 #include <linux/ctype.h>
+#include <linux/string.h>
 #endif /* SLRE_TEST */
 
 #include <errno.h>
lib/smbios-parser.c +0 -1
index 2b9392936b99..b578c3084081 100644
@@ -5,7 +5,6 @@
 
 #define LOG_CATEGORY	LOGC_BOOT
 
-#include <common.h>
 #include <smbios.h>
 
 static inline int verify_checksum(const struct smbios_entry *e)
lib/smbios.c +0 -1
index d7f4999e8b2a..807a021770cb 100644
@@ -5,7 +5,6 @@
  * Adapted from coreboot src/arch/x86/smbios.c
  */
 
-#include <common.h>
 #include <dm.h>
 #include <env.h>
 #include <linux/stringify.h>
lib/strto.c +1 -1
index 154921165cb2..5157332d6c1d 100644
@@ -9,9 +9,9 @@
  * Wirzenius wrote this portably, Torvalds fucked it up :-)
  */
 
-#include <common.h>
 #include <errno.h>
 #include <malloc.h>
+#include <vsprintf.h>
 #include <linux/ctype.h>
 
 /* from lib/kstrtox.c */
lib/tables_csum.c +1 -2
index e2630d57d912..636aa5967681 100644
@@ -3,8 +3,7 @@
  * Copyright (C) 2015, Bin Meng <[email protected]>
  */
 
-#include <common.h>
-#include <linux/ctype.h>
+#include <linux/types.h>
 
 u8 table_compute_checksum(void *v, int len)
 {
lib/time.c +0 -1
index 00f4a1ac8fb3..872f73d521e1 100644
@@ -4,7 +4,6 @@
  * Wolfgang Denk, DENX Software Engineering, [email protected].
  */
 
-#include <common.h>
 #include <clock_legacy.h>
 #include <bootstage.h>
 #include <dm.h>
lib/tiny-printf.c +0 -1
index f661fc65054a..9a70c6095b31 100644
@@ -8,7 +8,6 @@
  * Copyright (C) 2004,2008  Kustaa Nyholm
  */
 
-#include <common.h>
 #include <log.h>
 #include <serial.h>
 #include <stdarg.h>
lib/tpm-common.c +0 -1
index 82ffdc5341bc..b592c22bfc13 100644
@@ -6,7 +6,6 @@
 
 #define LOG_CATEGORY UCLASS_TPM
 
-#include <common.h>
 #include <dm.h>
 #include <log.h>
 #include <asm/unaligned.h>
lib/tpm-v1.c +0 -1
index 60a18ca50400..e66023da5e67 100644
@@ -6,7 +6,6 @@
 
 #define LOG_CATEGORY UCLASS_TPM
 
-#include <common.h>
 #include <dm.h>
 #include <log.h>
 #include <asm/unaligned.h>
lib/tpm-v2.c +0 -1
index bd0fb078dc3c..68eaaa639f89 100644
@@ -5,7 +5,6 @@
  * Author: Miquel Raynal <[email protected]>
  */
 
-#include <common.h>
 #include <dm.h>
 #include <dm/of_access.h>
 #include <tpm_api.h>
lib/tpm_api.c +0 -1
index 3ef5e811794f..39a5121e3028 100644
@@ -3,7 +3,6 @@
  * Copyright 2019 Google LLC
  */
 
-#include <common.h>
 #include <dm.h>
 #include <log.h>
 #include <tpm_api.h>
lib/trace.c +1 -1
index 4874bef861bf..cabbe47b58a3 100644
@@ -3,10 +3,10 @@
  * Copyright (c) 2012 The Chromium OS Authors.
  */
 
-#include <common.h>
 #include <mapmem.h>
 #include <time.h>
 #include <trace.h>
+#include <linux/errno.h>
 #include <asm/global_data.h>
 #include <asm/io.h>
 #include <asm/sections.h>
lib/uuid.c +0 -2
index afb40bff507a..0be22bc05f78 100644
@@ -9,7 +9,6 @@
 
 #define LOG_CATEGOT LOGC_CORE
 
-#include <common.h>
 #include <command.h>
 #include <efi_api.h>
 #include <env.h>
@@ -18,7 +17,6 @@
 #include <uuid.h>
 #include <linux/ctype.h>
 #include <errno.h>
-#include <common.h>
 #include <asm/io.h>
 #include <part_efi.h>
 #include <malloc.h>
lib/vsprintf.c +0 -1
index e14c6ca9f966..27ea9c907a32 100644
@@ -13,7 +13,6 @@
  * from hush: simple_itoa() was lifted from boa-0.93.15
  */
 
-#include <common.h>
 #include <charset.h>
 #include <efi_loader.h>
 #include <div64.h>
lib/zstd/zstd.c +1 -1
index 3a2abc836734..14bde369068d 100644
@@ -5,10 +5,10 @@
 
 #define LOG_CATEGORY	LOGC_BOOT
 
-#include <common.h>
 #include <abuf.h>
 #include <log.h>
 #include <malloc.h>
+#include <linux/errno.h>
 #include <linux/zstd.h>
 
 int zstd_decompress(struct abuf *in, struct abuf *out)
Signature · 1 line
2.34.1
Reviewed-by on v1 11/11
#23 lore raw

Re: [PATCH 11/11] lib: Remove <common.h> inclusion from these files

Quoted 98 lines · Tom Rini

After some header file cleanups to add missing include files, remove common.h from all files in the lib directory. This primarily means just dropping the line but in a few cases we need to add in other header files now.

---
 lib/abuf.c                                        | 1 -
 lib/acpi/acpi.c                                   | 1 -
 lib/acpi/acpi_device.c                            | 1 -
 lib/acpi/acpi_dp.c                                | 1 -
 lib/acpi/acpi_table.c                             | 1 -
 lib/acpi/acpi_writer.c                            | 2 +-
 lib/acpi/acpigen.c                                | 1 -
 lib/acpi/base.c                                   | 3 ++-
 lib/acpi/csrt.c                                   | 2 +-
 lib/acpi/dsdt.c                                   | 2 +-
 lib/acpi/facs.c                                   | 2 +-
 lib/acpi/mcfg.c                                   | 4 +++-
 lib/acpi/ssdt.c                                   | 3 ++-
 lib/addr_map.c                                    | 1 -
 lib/aes.c                                         | 2 +-
 lib/aes/aes-decrypt.c                             | 1 -
 lib/asm-offsets.c                                 | 2 +-
 lib/at91/at91.c                                   | 1 -
 lib/bch.c                                         | 1 -
 lib/binman.c                                      | 1 -
 lib/bzip2/bzlib.c                                 | 3 +--
 lib/bzip2/bzlib_decompress.c                      | 1 -
 lib/charset.c                                     | 1 -
 lib/circbuf.c                                     | 1 -
 lib/crc16-ccitt.c                                 | 2 --
 lib/crc32.c                                       | 1 -
 lib/crc32c.c                                      | 1 -
 lib/crc8.c                                        | 2 --
 lib/crypt/crypt-port.h                            | 3 +++
 lib/crypt/crypt.c                                 | 1 -
 lib/crypto/x509_public_key.c                      | 1 -
 lib/date.c                                        | 1 -
 lib/dhry/cmd_dhry.c                               | 3 ++-
 lib/dhry/dhry_1.c                                 | 2 +-
 lib/dhry/dhry_2.c                                 | 2 +-
 lib/efi/efi.c                                     | 1 -
 lib/efi/efi_app.c                                 | 1 -
 lib/efi/efi_info.c                                | 1 -
 lib/efi/efi_stub.c                                | 1 -
 lib/efi_driver/efi_block_device.c                 | 1 -
 lib/efi_driver/efi_uclass.c                       | 1 -
 lib/efi_selftest/efi_selftest_esrt.c              | 1 -
 lib/efi_selftest/efi_selftest_miniapp_exception.c | 1 -
 lib/efi_selftest/efi_selftest_miniapp_exit.c      | 1 -
 lib/efi_selftest/efi_selftest_miniapp_return.c    | 1 -
 lib/elf.c                                         | 1 -
 lib/errno_str.c                                   | 2 +-
 lib/fdtdec.c                                      | 1 -
 lib/fdtdec_common.c                               | 1 -
 lib/fdtdec_test.c                                 | 1 -
 lib/getopt.c                                      | 2 +-
 lib/gunzip.c                                      | 1 -
 lib/gzip.c                                        | 1 -
 lib/hang.c                                        | 2 +-
 lib/hash-checksum.c                               | 1 -
 lib/hashtable.c                                   | 1 -
 lib/hexdump.c                                     | 2 +-
 lib/image-sparse.c                                | 1 -
 lib/initcall.c                                    | 1 -
 lib/linux_compat.c                                | 1 -
 lib/list_sort.c                                   | 1 -
 lib/lmb.c                                         | 1 -
 lib/lz4.c                                         | 1 -
 lib/lz4_wrapper.c                                 | 1 -
 lib/lzma/LzmaDec.c                                | 1 -
 lib/lzma/LzmaTools.c                              | 1 -
 lib/lzo/lzo1x_decompress.c                        | 3 ++-
 lib/md5.c                                         | 1 -
 lib/membuff.c                                     | 1 -
 lib/net_utils.c                                   | 2 +-
 lib/of_live.c                                     | 1 -
 lib/optee/optee.c                                 | 1 -
 lib/panic.c                                       | 1 -
 lib/physmem.c                                     | 2 +-
 lib/qsort.c                                       | 1 -
 lib/rand.c                                        | 1 -
 lib/rc4.c                                         | 3 ---
 lib/rsa/rsa-keyprop.c                             | 1 -
 lib/rsa/rsa-mod-exp.c                             | 1 -
 lib/rsa/rsa-verify.c                              | 1 -
 lib/rtc-lib.c                                     | 1 -
 lib/semihosting.c                                 | 3 ++-
 lib/slre.c                                        | 2 +-
 lib/smbios-parser.c                               | 1 -
 lib/smbios.c                                      | 1 -
 lib/strto.c                                       | 2 +-
 lib/tables_csum.c                                 | 3 +--
 lib/time.c                                        | 1 -
 lib/tiny-printf.c                                 | 1 -
 lib/tpm-common.c                                  | 1 -
Quoted 9 lines
 lib/tpm-v1.c                                      | 1 -
 lib/tpm-v2.c                                      | 1 -
 lib/tpm_api.c                                     | 1 -
 lib/trace.c                                       | 2 +-
 lib/uuid.c                                        | 2 --
 lib/vsprintf.c                                    | 1 -
 lib/zstd/zstd.c                                   | 2 +-
 97 files changed, 36 insertions(+), 103 deletions(-)
Reviewed-by on v1 1/11
#24 lore raw
In reply to Tom Rini
Quoted 5 lines · Tom Rini

These files include <common.h> twice. Start by removing the second inclusion of the file.

Quoted 10 lines
---
 board/data_modul/common/common.c          | 1 -
 board/grinn/liteboard/board.c             | 1 -
 board/toradex/colibri_imx7/colibri_imx7.c | 1 -
 board/wandboard/wandboard.c               | 1 -
 drivers/gpio/gpio-aspeed.c                | 1 -
 drivers/spi/fsl_dspi.c                    | 1 -
 drivers/video/exynos/exynos_dp.c          | 1 -
 7 files changed, 7 deletions(-)