linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Russell King <rmk+kernel@armlinux.org.uk>
To: linux-i2c@vger.kernel.org
Subject: [PATCH v2 11/12] i2c: pxa: clean up decode_bits()
Date: Mon, 27 Apr 2020 19:49:27 +0100	[thread overview]
Message-ID: <E1jT8op-0002vi-Fy@rmk-PC.armlinux.org.uk> (raw)
In-Reply-To: <20200427184658.GM25745@shell.armlinux.org.uk>

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: Russell King <rmk+kernel@armlinux.org.uk>
---
 drivers/i2c/busses/i2c-pxa.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c
index 90b0599e3f77..f0205c47286c 100644
--- a/drivers/i2c/busses/i2c-pxa.c
+++ b/drivers/i2c/busses/i2c-pxa.c
@@ -286,13 +286,14 @@ struct bits {
 static inline void
 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--) {
 		const char *str = val & bits->mask ? bits->set : bits->unset;
 		if (str)
-			printk("%s ", str);
+			pr_cont(" %s", str);
 		bits++;
 	}
+	pr_cont("\n");
 }
 
 static const struct bits isr_bits[] = {
@@ -312,7 +313,6 @@ static const struct bits isr_bits[] = {
 static void decode_ISR(unsigned int val)
 {
 	decode_bits(KERN_DEBUG "ISR", isr_bits, ARRAY_SIZE(isr_bits), val);
-	printk("\n");
 }
 
 static const struct bits icr_bits[] = {
@@ -337,7 +337,6 @@ static const struct bits icr_bits[] = {
 static void decode_ICR(unsigned int val)
 {
 	decode_bits(KERN_DEBUG "ICR", icr_bits, ARRAY_SIZE(icr_bits), val);
-	printk("\n");
 }
 #endif
 
-- 
2.20.1


  parent reply	other threads:[~2020-04-27 18:49 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-27 18:46 [PATCH v2 00/12] i2c-pxa cleanups Russell King - ARM Linux admin
2020-04-27 18:48 ` [PATCH v2 01/12] i2c: pxa: use official address byte helper Russell King
2020-04-27 18:48 ` [PATCH v2 02/12] i2c: pxa: remove unneeded includes Russell King
2020-04-27 18:48 ` [PATCH v2 03/12] i2c: pxa: re-arrange includes to be in alphabetical order Russell King
2020-04-27 18:48 ` [PATCH v2 04/12] i2c: pxa: re-arrange functions to flow better Russell King
2020-04-27 18:48 ` [PATCH v2 05/12] i2c: pxa: re-arrange register field definitions Russell King
2020-04-27 18:49 ` [PATCH v2 06/12] i2c: pxa: add and use definitions for IBMR register Russell King
2020-04-27 18:49 ` [PATCH v2 07/12] i2c: pxa: always set fm and hs members for each type Russell King
2020-04-27 18:49 ` [PATCH v2 08/12] i2c: pxa: move private definitions to i2c-pxa.c Russell King
2020-04-27 18:49 ` [PATCH v2 09/12] i2c: pxa: move DT IDs along side platform IDs Russell King
2020-04-27 18:49 ` [PATCH v2 10/12] i2c: pxa: fix i2c_pxa_scream_blue_murder() debug output Russell King
2020-04-27 18:49 ` Russell King [this message]
2020-04-27 18:49 ` [PATCH v2 12/12] i2c: pxa: fix i2c_pxa_wait_bus_not_busy() boundary condition Russell King
2020-04-28 22:06 ` [PATCH v2 00/12] i2c-pxa cleanups Wolfram Sang
2020-05-05 12:02   ` Russell King - ARM Linux admin
2020-05-05 13:00     ` Wolfram Sang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1jT8op-0002vi-Fy@rmk-PC.armlinux.org.uk \
    --to=rmk+kernel@armlinux.org.uk \
    --cc=linux-i2c@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).