[PATCH] NOR flash: reduce size of cfiword_t if not using 64-bit bus.

Sascha Hauer s.hauer at pengutronix.de
Fri May 11 14:40:56 EDT 2012


Hi Krzysztof,

On Sat, May 05, 2012 at 11:35:10PM +0200, Krzysztof Halasa wrote:
> Signed-off-by: Krzysztof Hałasa <khc at pm.waw.pl>
> 
> diff --git a/drivers/nor/cfi_flash.h b/drivers/nor/cfi_flash.h
> index df482b6..fec0894 100644
> --- a/drivers/nor/cfi_flash.h
> +++ b/drivers/nor/cfi_flash.h
> @@ -30,7 +30,17 @@
>  #include <linux/mtd/mtd.h>
>  
>  typedef unsigned long flash_sect_t;
> +
> +#if   defined(CONFIG_DRIVER_CFI_BANK_WIDTH_8)
>  typedef u64 cfiword_t;
> +#elif defined(CONFIG_DRIVER_CFI_BANK_WIDTH_4)
> +typedef u32 cfiword_t;
> +#elif defined(CONFIG_DRIVER_CFI_BANK_WIDTH_2)
> +typedef u16 cfiword_t;
> +#else
> +typedef u8 cfiword_t;
> +#endif

Is this worth it? Do we safe binary size or what else is the reasoning
for this patch?

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list