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