
Hi Marek,
On 14-09-2012 19:21, Marek Vasut wrote:
Dear José Miguel Gonçalves,
NAND Flash driver with HW ECC for the S3C24XX SoCs. Currently it only supports SLC NAND chips.
Signed-off-by: José Miguel Gonçalves jose.goncalves@inov.pt
[...]
+#include <common.h> +#include <nand.h> +#include <asm/io.h> +#include <asm/arch/s3c24xx_cpu.h> +#include <asm/errno.h>
+#define MAX_CHIPS 2 +static int nand_cs[MAX_CHIPS] = { 0, 1 };
+#ifdef CONFIG_SPL_BUILD +#define printf(arg...) do {} while (0)
This doesn't seem quite right ...
- this should be in CPU directory
- should be enabled only if CONFIG_SPL_SERIAL_SUPPORT is not set
- should be inline function, not a macro
I'm having difficulties in following this suggestion. No problem if I migrate the printf as a macro to a header in the CPU directory. The problem is when I try to put it as an inline function. In this case if I define it like this;
#ifdef CONFIG_SPL_BUILD static inline int printf(const char *fmt, ...) { return 0; } #endif
I will get an "static declaration of `printf' follows non-static declaration" error due to the printf() declaration in common.h.
If I put this inline printf function (without the static) in a .c file in the CPU directory, it will compile but, as I expected, it will not be inlined, but it will be compiled as a normal function.
Can you detail on how to do this?
Best regards, José Gonçalves