[U-Boot] [PATCH] cfi_flash: Make all flash access functions weak

Haavard Skinnemoen haavard.skinnemoen at atmel.com
Mon Nov 17 10:40:16 CET 2008


Stefan Roese <sr at denx.de> wrote:
> I could do it this way, sure. But how about this version:
> 
> static void __flash_write8(u8 value, void *addr)
> {
> 	__raw_writeb(value, addr);
> }
> ...
> 
> #ifdef CONFIG_CFI_FLASH_USE_WEAK_ACCESSORS
> void flash_write8(u8 value, void *addr)__attribute__((weak, alias("__flash_write8")));
> ...
> #else
> #define flash_read8	__flash_read8
> ...
> #endif
> 
> We would still have the original accessor functions this way. And the
> resulting source code looks a little "better" to me (less #ifdef's).

Hmm...1 #ifdef vs. 1 #ifdef...I'd say that's pretty much the same ;-)

But sure, your way works too.

Haavard


More information about the U-Boot mailing list