[PATCH 09/16] common: Drop stdarg.h from common header

Simon Glass sjg at chromium.org
Mon Aug 3 00:59:33 CEST 2020


Move this out of the common header and include it only where needed.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 api/api.c                                       | 1 +
 board/CZ.NIC/turris_mox/turris_mox.c            | 1 +
 common/lcd_console.c                            | 1 +
 common/log.c                                    | 1 +
 common/log_syslog.c                             | 1 +
 drivers/core/util.c                             | 1 +
 drivers/fastboot/fb_common.c                    | 1 +
 drivers/gpio/gpio-uclass.c                      | 1 +
 drivers/mtd/nand/raw/brcmnand/brcmnand_compat.c | 1 +
 include/common.h                                | 1 -
 include/efi.h                                   | 1 +
 include/exports.h                               | 1 +
 lib/efi_selftest/efi_selftest_console.c         | 1 +
 lib/panic.c                                     | 1 +
 lib/tpm-common.c                                | 1 +
 post/post.c                                     | 1 +
 test/ut.c                                       | 1 +
 17 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/api/api.c b/api/api.c
index d6b5b60c225..748df20bebe 100644
--- a/api/api.c
+++ b/api/api.c
@@ -11,6 +11,7 @@
 #include <env.h>
 #include <malloc.h>
 #include <env_internal.h>
+#include <stdarg.h>
 #include <stdio.h>
 #include <time.h>
 #include <linux/delay.h>
diff --git a/board/CZ.NIC/turris_mox/turris_mox.c b/board/CZ.NIC/turris_mox/turris_mox.c
index f5fcb93262b..7f2ed1350bf 100644
--- a/board/CZ.NIC/turris_mox/turris_mox.c
+++ b/board/CZ.NIC/turris_mox/turris_mox.c
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <stdarg.h>
 #include <stdio.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/soc.h>
diff --git a/common/lcd_console.c b/common/lcd_console.c
index 7a10a20d724..0ccb4a46880 100644
--- a/common/lcd_console.c
+++ b/common/lcd_console.c
@@ -11,6 +11,7 @@
 #include <lcd.h>
 #include <log.h>
 #include <serial.h>
+#include <stdarg.h>
 #include <video_font.h>		/* Get font data, width and height */
 #if defined(CONFIG_LCD_LOGO)
 #include <bmp_logo.h>
diff --git a/common/log.c b/common/log.c
index 0eeee6a66b0..493ee0ff0d9 100644
--- a/common/log.c
+++ b/common/log.c
@@ -9,6 +9,7 @@
 #include <common.h>
 #include <log.h>
 #include <malloc.h>
+#include <stdarg.h>
 #include <asm/global_data.h>
 #include <dm/uclass.h>
 #include <linux/string.h>
diff --git a/common/log_syslog.c b/common/log_syslog.c
index 2f3c93bf839..6cb4ed18ca1 100644
--- a/common/log_syslog.c
+++ b/common/log_syslog.c
@@ -8,6 +8,7 @@
 #include <common.h>
 #include <log.h>
 #include <net.h>
+#include <stdarg.h>
 #include <asm/global_data.h>
 #include <linux/string.h>
 
diff --git a/drivers/core/util.c b/drivers/core/util.c
index 7a2fe1f4394..cd15768970c 100644
--- a/drivers/core/util.c
+++ b/drivers/core/util.c
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <stdarg.h>
 #include <stdio.h>
 #include <dm/device.h>
 #include <dm/ofnode.h>
diff --git a/drivers/fastboot/fb_common.c b/drivers/fastboot/fb_common.c
index da467666cf4..325ce4d283f 100644
--- a/drivers/fastboot/fb_common.c
+++ b/drivers/fastboot/fb_common.c
@@ -14,6 +14,7 @@
 #include <command.h>
 #include <env.h>
 #include <fastboot.h>
+#include <stdarg.h>
 #include <stdio.h>
 #include <linux/string.h>
 #include <net/fastboot.h>
diff --git a/drivers/gpio/gpio-uclass.c b/drivers/gpio/gpio-uclass.c
index 7d4e3354f17..2e371f3ad79 100644
--- a/drivers/gpio/gpio-uclass.c
+++ b/drivers/gpio/gpio-uclass.c
@@ -6,6 +6,7 @@
 #include <common.h>
 #include <dm.h>
 #include <log.h>
+#include <stdarg.h>
 #include <stdio.h>
 #include <asm/global_data.h>
 #include <dm/device-internal.h>
diff --git a/drivers/mtd/nand/raw/brcmnand/brcmnand_compat.c b/drivers/mtd/nand/raw/brcmnand/brcmnand_compat.c
index c58679834ed..93c75e4d9bb 100644
--- a/drivers/mtd/nand/raw/brcmnand/brcmnand_compat.c
+++ b/drivers/mtd/nand/raw/brcmnand/brcmnand_compat.c
@@ -2,6 +2,7 @@
 
 #include <common.h>
 #include <malloc.h>
+#include <stdarg.h>
 #include <dm/devres.h>
 #include "brcmnand_compat.h"
 
diff --git a/include/common.h b/include/common.h
index 33171360ddb..31c3d462132 100644
--- a/include/common.h
+++ b/include/common.h
@@ -16,7 +16,6 @@
 #include <config.h>
 #include <errno.h>
 #include <linux/types.h>
-#include <stdarg.h>
 #include <linux/kernel.h>
 #include <vsprintf.h>
 #endif	/* __ASSEMBLY__ */
diff --git a/include/efi.h b/include/efi.h
index f986aad8777..818295642dd 100644
--- a/include/efi.h
+++ b/include/efi.h
@@ -16,6 +16,7 @@
 #ifndef _EFI_H
 #define _EFI_H
 
+#include <stdarg.h>
 #include <linux/linkage.h>
 #include <linux/string.h>
 #include <linux/types.h>
diff --git a/include/exports.h b/include/exports.h
index 5e10fc3bce5..935cf594c3b 100644
--- a/include/exports.h
+++ b/include/exports.h
@@ -2,6 +2,7 @@
 #define __EXPORTS_H__
 
 #include <irq_func.h>
+#include <stdarg.h>
 #include <stdio.h>
 #include <time.h>
 #include <asm/global_data.h>
diff --git a/lib/efi_selftest/efi_selftest_console.c b/lib/efi_selftest/efi_selftest_console.c
index 13f3ee6bc19..0462c196c16 100644
--- a/lib/efi_selftest/efi_selftest_console.c
+++ b/lib/efi_selftest/efi_selftest_console.c
@@ -7,6 +7,7 @@
 
 #include <efi_selftest.h>
 #include <net.h>
+#include <stdarg.h>
 #include <vsprintf.h>
 
 struct efi_simple_text_output_protocol *con_out;
diff --git a/lib/panic.c b/lib/panic.c
index eba1d43b755..2267a8d4fb9 100644
--- a/lib/panic.c
+++ b/lib/panic.c
@@ -14,6 +14,7 @@
 #if !defined(CONFIG_PANIC_HANG)
 #include <command.h>
 #endif
+#include <stdarg.h>
 #include <stdio.h>
 #include <linux/delay.h>
 
diff --git a/lib/tpm-common.c b/lib/tpm-common.c
index adfe4919069..21fc4c7c865 100644
--- a/lib/tpm-common.c
+++ b/lib/tpm-common.c
@@ -9,6 +9,7 @@
 #include <common.h>
 #include <dm.h>
 #include <log.h>
+#include <stdarg.h>
 #include <asm/unaligned.h>
 #include <tpm-common.h>
 #include <linux/string.h>
diff --git a/post/post.c b/post/post.c
index 5671da10251..ad700975846 100644
--- a/post/post.c
+++ b/post/post.c
@@ -9,6 +9,7 @@
 #include <env.h>
 #include <log.h>
 #include <malloc.h>
+#include <stdarg.h>
 #include <stdio.h>
 #include <stdio_dev.h>
 #include <time.h>
diff --git a/test/ut.c b/test/ut.c
index 7acaae23d1d..ef5152bfdf0 100644
--- a/test/ut.c
+++ b/test/ut.c
@@ -8,6 +8,7 @@
 #include <common.h>
 #include <console.h>
 #include <malloc.h>
+#include <stdarg.h>
 #include <stdio.h>
 #include <asm/global_data.h>
 #include <test/test.h>
-- 
2.28.0.163.g6104cc2f0b6-goog



More information about the U-Boot mailing list