Skip to contentSkip to conversation

global_data.h: make <asm-generic/global_data.h> self-contained

PATCH New Masahiro Yamada 2 participants 2 messages Feb 24, 2020 – Mar 17, 2020 Generic include/asm header files

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 global_data.h: make <asm-generic/global_data.h> self-contained

The compiler never knows what 'bd_t' is without including <asm/u-boot.h>.

By changing it to (struct bd_info), the compiler learns it is struct.

---

Maybe, we should replace 'bd_t' with 'struct bd_info' globally by using coccinelle or something.

Linux coding style (Documentation/process/coding-style.rst) apparently discourages typedef for cases like this.

 include/asm-generic/global_data.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/asm-generic/global_data.h +1 -1
index 5d027329fe..d9e220cfe3 100644
@@ -25,7 +25,7 @@
 #include <linux/list.h>
 
 typedef struct global_data {
-	bd_t *bd;
+	struct bd_info *bd;
 	unsigned long flags;
 	unsigned int baudrate;
 	unsigned long cpu_clk;		/* CPU clock in Hz!		*/
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 global_data.h: make <asm-generic/global_data.h> self-contained

Quoted 5 lines · Masahiro Yamada

The compiler never knows what 'bd_t' is without including <asm/u-boot.h>.

By changing it to (struct bd_info), the compiler learns it is struct.

Applied to u-boot/next, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200317/29bb983c/attachment.sig>