[U-Boot] [PATCH 02/22] ARM: sunxi: MMC driver

Henrik Nordström
2012-11-25T15:39:03Z

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?

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

> > +static void dumpmmcreg(struct sunxi_mmc *reg)
> > +{
>
> I dont see this function is called anywhere...

Indeed. Current debug code dumps the register space in hex instead.

Added back a call as it's easier to decipher than the hex dump.

> > -#define CONFIG_ENV_OFFSET (544 << 10) /* (8 + 24 + 512)KB */
> > +#define CONFIG_ENV_OFFSET (544 << 10) /* (8 + 24 + 512)KB */
>
> The comment moving should go in the first patch.

Fixed.

Regards
Henrik