From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?ISO-8859-1?Q?Jos=E9_Miguel_Gon=E7alves?= Date: Mon, 17 Sep 2012 12:11:39 +0100 Subject: [U-Boot] [PATCH v2 09/11] S3C24XX: Add NAND Flash driver In-Reply-To: <201209142021.12033.marex@denx.de> References: <1347643742-19966-1-git-send-email-jose.goncalves@inov.pt> <1347643742-19966-10-git-send-email-jose.goncalves@inov.pt> <201209142021.12033.marex@denx.de> Message-ID: <5057056B.8050708@inov.pt> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 > [...] > >> +#include >> +#include >> +#include >> +#include >> +#include >> + >> +#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 ... > > 1) this should be in CPU directory > 2) should be enabled only if CONFIG_SPL_SERIAL_SUPPORT is not set > 3) 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