diff mbox series

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

Message ID 20200224172227.13302-1-masahiroy@kernel.org
State Accepted
Commit b36992fb6b6d2d53a2cf1a5158ad6ed1335b0de9
Headers show
Series global_data.h: make <asm-generic/global_data.h> self-contained | expand

Commit Message

Masahiro Yamada Feb. 24, 2020, 5:22 p.m. UTC
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.

Signed-off-by: Masahiro Yamada <masahiroy at kernel.org>
---

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(-)

Comments

Tom Rini March 17, 2020, 3:28 p.m. UTC | #1
On Tue, Feb 25, 2020 at 02:22:27AM +0900, Masahiro Yamada wrote:

> 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.
> 
> Signed-off-by: Masahiro Yamada <masahiroy at kernel.org>

Applied to u-boot/next, thanks!
diff mbox series

Patch

diff --git a/include/asm-generic/global_data.h b/include/asm-generic/global_data.h
index 5d027329fe..d9e220cfe3 100644
--- a/include/asm-generic/global_data.h
+++ b/include/asm-generic/global_data.h
@@ -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!		*/