2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-19 18:53:52 +08:00

mmc: tmio_mmc: Improve readability of the output of pr_debug_status()

Reviewed-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Chris Ball <cjb@laptop.org>
This commit is contained in:
Simon Horman 2011-02-09 07:25:22 +09:00 committed by Chris Ball
parent a803d551d9
commit a803d7fbc1

View File

@ -228,36 +228,40 @@ static void tmio_mmc_kunmap_atomic(void *virt, unsigned long *flags)
#ifdef CONFIG_MMC_DEBUG #ifdef CONFIG_MMC_DEBUG
#define STATUS_TO_TEXT(a) \ #define STATUS_TO_TEXT(a, status, i) \
do { \ do { \
if (status & TMIO_STAT_##a) \ if (status & TMIO_STAT_##a) { \
if (i++) \
printk(" | "); \
printk(#a); \ printk(#a); \
} \
} while (0) } while (0)
void pr_debug_status(u32 status) void pr_debug_status(u32 status)
{ {
int i = 0;
printk(KERN_DEBUG "status: %08x = ", status); printk(KERN_DEBUG "status: %08x = ", status);
STATUS_TO_TEXT(CARD_REMOVE); STATUS_TO_TEXT(CARD_REMOVE, status, i);
STATUS_TO_TEXT(CARD_INSERT); STATUS_TO_TEXT(CARD_INSERT, status, i);
STATUS_TO_TEXT(SIGSTATE); STATUS_TO_TEXT(SIGSTATE, status, i);
STATUS_TO_TEXT(WRPROTECT); STATUS_TO_TEXT(WRPROTECT, status, i);
STATUS_TO_TEXT(CARD_REMOVE_A); STATUS_TO_TEXT(CARD_REMOVE_A, status, i);
STATUS_TO_TEXT(CARD_INSERT_A); STATUS_TO_TEXT(CARD_INSERT_A, status, i);
STATUS_TO_TEXT(SIGSTATE_A); STATUS_TO_TEXT(SIGSTATE_A, status, i);
STATUS_TO_TEXT(CMD_IDX_ERR); STATUS_TO_TEXT(CMD_IDX_ERR, status, i);
STATUS_TO_TEXT(STOPBIT_ERR); STATUS_TO_TEXT(STOPBIT_ERR, status, i);
STATUS_TO_TEXT(ILL_FUNC); STATUS_TO_TEXT(ILL_FUNC, status, i);
STATUS_TO_TEXT(CMD_BUSY); STATUS_TO_TEXT(CMD_BUSY, status, i);
STATUS_TO_TEXT(CMDRESPEND); STATUS_TO_TEXT(CMDRESPEND, status, i);
STATUS_TO_TEXT(DATAEND); STATUS_TO_TEXT(DATAEND, status, i);
STATUS_TO_TEXT(CRCFAIL); STATUS_TO_TEXT(CRCFAIL, status, i);
STATUS_TO_TEXT(DATATIMEOUT); STATUS_TO_TEXT(DATATIMEOUT, status, i);
STATUS_TO_TEXT(CMDTIMEOUT); STATUS_TO_TEXT(CMDTIMEOUT, status, i);
STATUS_TO_TEXT(RXOVERFLOW); STATUS_TO_TEXT(RXOVERFLOW, status, i);
STATUS_TO_TEXT(TXUNDERRUN); STATUS_TO_TEXT(TXUNDERRUN, status, i);
STATUS_TO_TEXT(RXRDY); STATUS_TO_TEXT(RXRDY, status, i);
STATUS_TO_TEXT(TXRQ); STATUS_TO_TEXT(TXRQ, status, i);
STATUS_TO_TEXT(ILL_ACCESS); STATUS_TO_TEXT(ILL_ACCESS, status, i);
printk("\n"); printk("\n");
} }