b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame^] | 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 | --- 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 | |