From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Mon, 30 Apr 2012 04:23:49 +0200 Subject: [U-Boot] [PATCH 2/5] x86: Forward declate gd_t In-Reply-To: <1335700823-15144-3-git-send-email-graeme.russ@gmail.com> References: <1335700823-15144-1-git-send-email-graeme.russ@gmail.com> <1335700823-15144-3-git-send-email-graeme.russ@gmail.com> Message-ID: <201204300423.49647.marex@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Graeme Russ, > So it can be used as a type in struct global_data and remove an ugly > typecast > > Signed-off-by: Graeme Russ > --- > arch/x86/cpu/cpu.c | 2 +- > arch/x86/include/asm/global_data.h | 4 +++- > 2 files changed, 4 insertions(+), 2 deletions(-) > > diff --git a/arch/x86/cpu/cpu.c b/arch/x86/cpu/cpu.c > index e9bb0d7..67de6bc 100644 > --- a/arch/x86/cpu/cpu.c > +++ b/arch/x86/cpu/cpu.c > @@ -92,7 +92,7 @@ static void load_gdt(const u64 *boot_gdt, u16 > num_entries) > > void init_gd(gd_t *id, u64 *gdt_addr) > { > - id->gd_addr = (ulong)id; > + id->gd_addr = id; > setup_gdt(id, gdt_addr); > } > > diff --git a/arch/x86/include/asm/global_data.h > b/arch/x86/include/asm/global_data.h index 908a02c..8a8896e 100644 > --- a/arch/x86/include/asm/global_data.h > +++ b/arch/x86/include/asm/global_data.h > @@ -35,9 +35,11 @@ > > #ifndef __ASSEMBLY__ > > +typedef struct global_data gd_t; > + > typedef struct global_data { > /* NOTE: gd_addr MUST be first member of struct global_data! */ > - unsigned long gd_addr; /* Location of Global Data */ > + gd_t *gd_addr; /* Location of Global Data */ > bd_t *bd; > unsigned long flags; > unsigned long baudrate; Acked-by: Marek Vasut Best regards, Marek Vasut