Commit bb82ba69 authored by Russell King's avatar Russell King Committed by Wolfram Sang

i2c: pxa: clean up decode_bits()

Clean up decode_bits() to use pr_cont(), and move the newline into the
function rather than at its two callsites. Avoid printing an
unnecessary space before the newline.
Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
parent 88b73ee7
...@@ -286,13 +286,14 @@ struct bits { ...@@ -286,13 +286,14 @@ struct bits {
static inline void static inline void
decode_bits(const char *prefix, const struct bits *bits, int num, u32 val) decode_bits(const char *prefix, const struct bits *bits, int num, u32 val)
{ {
printk("%s %08x: ", prefix, val); printk("%s %08x:", prefix, val);
while (num--) { while (num--) {
const char *str = val & bits->mask ? bits->set : bits->unset; const char *str = val & bits->mask ? bits->set : bits->unset;
if (str) if (str)
printk("%s ", str); pr_cont(" %s", str);
bits++; bits++;
} }
pr_cont("\n");
} }
static const struct bits isr_bits[] = { static const struct bits isr_bits[] = {
...@@ -312,7 +313,6 @@ static const struct bits isr_bits[] = { ...@@ -312,7 +313,6 @@ static const struct bits isr_bits[] = {
static void decode_ISR(unsigned int val) static void decode_ISR(unsigned int val)
{ {
decode_bits(KERN_DEBUG "ISR", isr_bits, ARRAY_SIZE(isr_bits), val); decode_bits(KERN_DEBUG "ISR", isr_bits, ARRAY_SIZE(isr_bits), val);
printk("\n");
} }
static const struct bits icr_bits[] = { static const struct bits icr_bits[] = {
...@@ -337,7 +337,6 @@ static const struct bits icr_bits[] = { ...@@ -337,7 +337,6 @@ static const struct bits icr_bits[] = {
static void decode_ICR(unsigned int val) static void decode_ICR(unsigned int val)
{ {
decode_bits(KERN_DEBUG "ICR", icr_bits, ARRAY_SIZE(icr_bits), val); decode_bits(KERN_DEBUG "ICR", icr_bits, ARRAY_SIZE(icr_bits), val);
printk("\n");
} }
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment