From mboxrd@z Thu Jan 1 00:00:00 1970 From: Luka Perkov Date: Sun, 25 Nov 2012 18:07:30 +0100 Subject: [U-Boot] [PATCH 02/22] ARM: sunxi: MMC driver In-Reply-To: <1353857943.28559.24.camel@home.hno.se> References: <1353843479.17518.14.camel@home.hno.se> <20121125143332-9180@mutt-kz> <1353857943.28559.24.camel@home.hno.se> Message-ID: <20121125170730-27745@mutt-kz> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Sun, Nov 25, 2012 at 04:39:03PM +0100, Henrik Nordstr?m wrote: > s?n 2012-11-25 klockan 15:33 +0100 skrev Luka Perkov: > > > +#define MMCDBG(fmt...) printf("[mmc]: "fmt) > > > > Why not reuse something from existing uboot code ? (exaple from api/api.c): > > > > > > 53 #ifdef DEBUG > > 54 #define debugf(fmt, args...) do { printf("%s(): ", __func__); printf(fmt, ##args); } while (0) > > 55 #else > > 56 #define debugf(fmt, args...) > > 57 #endif > > Because it's not in a reusable header? I know, but it might be a good idea to put it somewhere there. > But should at least use up to date syntax, and debug() instead of > printf, and less #ifdefs. > > What about this: > > #define MMCDBG(fmt, args...) debug("[sunxi_mmc] " fmt, ##args) > > and printf() changed to debug() in the other debug helpers, and no > #ifdefs, the compiler will sort it out nicely at -OS I don't know. Maybe u-boot developers could tell us what is the best way to do it... Luka