blob: adcf969ef6f42e69001e3973b17e50ac65117fd4 [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001From: Russell King <rmk+kernel@armlinux.org.uk>
2Bcc: linux@mail.armlinux.org.uk
3Cc: linux-i2c@vger.kernel.org
4Subject: [PATCH 11/17] i2c: pxa: clean up decode_bits()
5MIME-Version: 1.0
6Content-Disposition: inline
7Content-Transfer-Encoding: 8bit
8Content-Type: text/plain; charset="utf-8"
9
10Clean up decode_bits() to use pr_cont(), and move the newline into the
11function rather than at its two callsites. Avoid printing an
12unnecessary space before the newline.
13
14Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
15---
16 drivers/i2c/busses/i2c-pxa.c | 7 +++----
17 1 file changed, 3 insertions(+), 4 deletions(-)
18
19--- a/drivers/i2c/busses/i2c-pxa.c
20+++ b/drivers/i2c/busses/i2c-pxa.c
21@@ -287,13 +287,14 @@ struct bits {
22 static inline void
23 decode_bits(const char *prefix, const struct bits *bits, int num, u32 val)
24 {
25- printk("%s %08x: ", prefix, val);
26+ printk("%s %08x:", prefix, val);
27 while (num--) {
28 const char *str = val & bits->mask ? bits->set : bits->unset;
29 if (str)
30- printk("%s ", str);
31+ pr_cont(" %s", str);
32 bits++;
33 }
34+ pr_cont("\n");
35 }
36
37 static const struct bits isr_bits[] = {
38@@ -313,7 +314,6 @@ static const struct bits isr_bits[] = {
39 static void decode_ISR(unsigned int val)
40 {
41 decode_bits(KERN_DEBUG "ISR", isr_bits, ARRAY_SIZE(isr_bits), val);
42- printk("\n");
43 }
44
45 static const struct bits icr_bits[] = {
46@@ -338,7 +338,6 @@ static const struct bits icr_bits[] = {
47 static void decode_ICR(unsigned int val)
48 {
49 decode_bits(KERN_DEBUG "ICR", icr_bits, ARRAY_SIZE(icr_bits), val);
50- printk("\n");
51 }
52 #endif
53