linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christian Vogel <vogelchr@vogel.cx>
To: greg@kroah.com, linux-kernel@vger.kernel.org
Cc: zbr@ioremap.net, vogelchr@vogel.cx
Subject: [PATCH 1/2] w1/ds2490: remove spurious newlines within hexdump
Date: Fri, 11 Mar 2022 20:28:32 +0100	[thread overview]
Message-ID: <20220311192833.1792-2-vogelchr@vogel.cx> (raw)
In-Reply-To: <20220311192833.1792-1-vogelchr@vogel.cx>

Multiple pr_infos generate newlines, so the hexdump looks like...

> 0x81: count=16, status:
> 01
> 00
> 20
(...16 lines...)

We switch to a single %*ph hexdump, using the built-in %ph format,
which leads to this:

	[52769.348789] usb 2-1.3.1: Clearing ep0x83.
	[52769.349729] usb 2-1.3.1: ep_status=0x81, count=16,...
		...status=01:00:20:40:05:04:04:00:20:53:00:00:00:00:00:00

Signed-off-by: Christian Vogel <vogelchr@vogel.cx>
---
 drivers/w1/masters/ds2490.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/w1/masters/ds2490.c b/drivers/w1/masters/ds2490.c
index cd8821580f71..f6664fc9596a 100644
--- a/drivers/w1/masters/ds2490.c
+++ b/drivers/w1/masters/ds2490.c
@@ -219,10 +219,8 @@ static void ds_dump_status(struct ds_device *dev, unsigned char *buf, int count)
 {
 	int i;
 
-	pr_info("0x%x: count=%d, status: ", dev->ep[EP_STATUS], count);
-	for (i = 0; i < count; ++i)
-		pr_info("%02x ", buf[i]);
-	pr_info("\n");
+	dev_info(&dev->udev->dev, "ep_status=0x%x, count=%d, status=%*phC",
+		dev->ep[EP_STATUS], count, count, buf);
 
 	if (count >= 16) {
 		ds_print_msg(buf, "enable flag", 0);
@@ -331,7 +329,7 @@ static int ds_recv_data(struct ds_device *dev, unsigned char *buf, int size)
 	err = usb_bulk_msg(dev->udev, usb_rcvbulkpipe(dev->udev, dev->ep[EP_DATA_IN]),
 				buf, size, &count, 1000);
 	if (err < 0) {
-		pr_info("Clearing ep0x%x.\n", dev->ep[EP_DATA_IN]);
+		dev_info(&dev->udev->dev, "Clearing ep0x%x.\n", dev->ep[EP_DATA_IN]);
 		usb_clear_halt(dev->udev, usb_rcvbulkpipe(dev->udev, dev->ep[EP_DATA_IN]));
 		ds_recv_status(dev, NULL, true);
 		return err;
-- 
2.35.1


  reply	other threads:[~2022-03-11 19:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-11 19:28 w1/ds2490: fix excessive logging Christian Vogel
2022-03-11 19:28 ` Christian Vogel [this message]
2022-03-11 19:28 ` [PATCH 2/2] w1/ds2490: remove dump from ds_recv_status & less verbose Christian Vogel
2022-03-18 13:06   ` Greg KH
2022-03-24 19:32     ` w1/ds2490: fix excessive logging Christian Vogel
2022-03-24 19:32       ` [PATCH 2/2] w1/ds2490: remove dump from ds_recv_status, pr_ to dev_XXX logging Christian Vogel

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=20220311192833.1792-2-vogelchr@vogel.cx \
    --to=vogelchr@vogel.cx \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zbr@ioremap.net \
    /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).