[U-Boot] [RFC][PATCH 14/19] nand_fsl_nfc: get rid of local var

Heiko Schocher hs at denx.de
Fri Jul 30 08:24:35 CEST 2010


Hello Scott,

Scott Wood wrote:
> On Thu, 29 Jul 2010 12:45:03 +0200
> Heiko Schocher <hs at denx.de> wrote:
> 
>> If we have -fPIC enabled, this var leads in one entry in the
>> GOT. The result of this is that the image size is > 0x800.
>>
>> Signed-off-by: Heiko Schocher <hs at denx.de>
> 
> Acked-by: Scott Wood <scottwood at freescale.com>
> 
>> diff --git a/nand_spl/nand_boot_fsl_nfc.c b/nand_spl/nand_boot_fsl_nfc.c
>> index 9720f6a..0543512 100644
>> --- a/nand_spl/nand_boot_fsl_nfc.c
>> +++ b/nand_spl/nand_boot_fsl_nfc.c
>> @@ -34,10 +34,9 @@
>>  #include <asm/io.h>
>>  #include <fsl_nfc.h>
>>
>> -struct fsl_nfc_regs *nfc;
>> -
>>  static void nfc_wait_ready(void)
>>  {
>> +	struct fsl_nfc_regs *nfc = (void *)NFC_BASE_ADDR;
> 
> Alternatively, would this work at file scope?
> 
> static struct fsl_nfc_regs *const nfc = (void *)NFC_BASE_ADDR;

Great tip! Thanks, this works also, I fix this in version 2

bye
Heiko
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany


More information about the U-Boot mailing list