mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Marco Felsch <m.felsch@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 3/4] lib: hexdump: make use of pr_debug
Date: Fri, 17 Oct 2025 14:03:35 +0200	[thread overview]
Message-ID: <20251017120406.1348897-3-m.felsch@pengutronix.de> (raw)
In-Reply-To: <20251017120406.1348897-1-m.felsch@pengutronix.de>

The hexdump library was ported from Linux which supports different
printk() level. Because the barebox print* facility is different
compared to the one from Linux the barebox printk() doesn't support
levels. Therefore the level is always set to an empty string.

Furthermore all barebox printk() calls aren't recorded by the internal
barebox_logbuf because they are mostly used for command prints. Linux on
the other hand record each printk() print.

Not recording the output can be an issue on systems which don't have a
hw-console but a USB-ACM console, because the hexdump call may already
occurred before the console was ready.

Make use of pr_debug() instead to record the output within the
barebox_logbuf to be available later on via dmesg. Using pr_debug()
should be fine since it is mostly used for debugging/development
purpose.

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
---
 lib/hexdump.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/lib/hexdump.c b/lib/hexdump.c
index 940c4eec64e9..ab5e3cf727ec 100644
--- a/lib/hexdump.c
+++ b/lib/hexdump.c
@@ -284,16 +284,13 @@ void dev_print_hex_dump(struct device *dev, const char *level,
 
 		switch (prefix_type) {
 		case DUMP_PREFIX_ADDRESS:
-			printk("%s%s%s%p: %s\n", level, name, prefix_str,
-			       ptr + i, linebuf);
+			pr_debug("%s%s%p: %s\n", name, prefix_str, ptr + i, linebuf);
 			break;
 		case DUMP_PREFIX_OFFSET:
-			printk("%s%s%s%.8x: %s\n", level, name, prefix_str,
-			       i, linebuf);
+			pr_debug("%s%s%.8x: %s\n", name, prefix_str, i, linebuf);
 			break;
 		default:
-			printk("%s%s%s%s\n", level, name, prefix_str,
-			       linebuf);
+			pr_debug("%s%s%s\n", name, prefix_str, linebuf);
 			break;
 		}
 	}
-- 
2.47.3




  parent reply	other threads:[~2025-10-17 12:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-17 12:03 [PATCH 1/4] ARM: i.MX8MM: add MX8MM_PAD_CTL defines Marco Felsch
2025-10-17 12:03 ` [PATCH 2/4] lib: port CRC16 implementation from Linux Marco Felsch
2025-10-20  8:31   ` Sascha Hauer
2025-10-20  8:45     ` Marco Felsch
2025-10-17 12:03 ` Marco Felsch [this message]
2025-10-20  8:44   ` [PATCH 3/4] lib: hexdump: make use of pr_debug Sascha Hauer
2025-10-20  8:49     ` Marco Felsch
2025-10-20  9:02       ` Sascha Hauer
2025-10-20  9:27         ` Marco Felsch
2025-10-17 12:03 ` [PATCH 4/4] aiodev: add missing headers Marco Felsch
2025-10-20  8:45   ` (subset) " Sascha Hauer

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=20251017120406.1348897-3-m.felsch@pengutronix.de \
    --to=m.felsch@pengutronix.de \
    --cc=barebox@lists.infradead.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