Patchwork [U-Boot] Use sizeof(gd_t), not sizeof(struct global_data)

mail settings
Submitter Wolfgang Denk
Date Jan. 3, 2011, 4:51 p.m.
Message ID <>
Download mbox | patch
Permalink /patch/77297/
State Accepted
Commit de47cbe6860654cc6c0cf8820d9165f059c7cf38
Headers show


Wolfgang Denk - Jan. 3, 2011, 4:51 p.m.
Dear =?UTF-8?q?Lo=C3=AFc=20Minier?=,

In message <> you wrote:
> The eNET (x86) build fails with "invalid application of 'sizeof' to
> incomplete type 'struct global_data'" because x86 doesn't define
> struct global_data.  Change sizeof(struct global_data) to sizeof(gd_t)
> which is always available.

Um... I do not like this change; the resulting code is harder to read.

Can you please change the struct declaration isntead, like this:

Best regards,

Wolfgang Denk
Loïc Minier - Jan. 3, 2011, 5:03 p.m.
On Mon, Jan 03, 2011, Wolfgang Denk wrote:
> Um... I do not like this change; the resulting code is harder to read.

 I don't mind either way; I had asked
 <> which one was the preferred
 approach, but didn't get comments on this particular point; see
 <> for the rationale for picking
 this option rather than the other one.

 I've sent a second patch to also define struct global_data; feel free
 to cherry pick any of the two patches or both



diff --git a/arch/i386/include/asm/global_data.h b/arch/i386/include/asm/global_data.h
index e3f8a25..e9000c3 100644
--- a/arch/i386/include/asm/global_data.h
+++ b/arch/i386/include/asm/global_data.h
@@ -35,7 +35,7 @@ 
 #ifndef __ASSEMBLY__
-typedef	struct {
+typedef	struct global_data {
 	bd_t		*bd;
 	unsigned long	flags;
 	unsigned long	baudrate;