public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Roman Fietze <roman.fietze@magna.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: <linux-kernel@vger.kernel.org>
Subject: [PATCH] print_hex_dump: use %px when using DUMP_PREFIX_ADDRESS
Date: Wed, 24 Jun 2020 14:15:24 +0200	[thread overview]
Message-ID: <1946561.0luHp2vXsY@rfietze> (raw)

This function is mainly used for debugging. But for that purpose the
hashed memory address of the dumped data provides no useful
information at all.

Note: There are only very few locations in the kernel, where
print_hex_dump is not used with KERN_DEBUG and DUMP_PREFIX_ADDRESS.

Signed-off-by: Roman Fietze <roman.fietze@magna.com>
---
 lib/hexdump.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/hexdump.c b/lib/hexdump.c
index 147133f8eb2f..52dd2fc1c8b4 100644
--- a/lib/hexdump.c
+++ b/lib/hexdump.c
@@ -256,7 +256,7 @@ void print_hex_dump(const char *level, const char 
*prefix_str, int prefix_type,
 
                switch (prefix_type) {
                case DUMP_PREFIX_ADDRESS:
-                       printk("%s%s%p: %s\n",
+                       printk("%s%s%px: %s\n",
                               level, prefix_str, ptr + i, linebuf);
                        break;
                case DUMP_PREFIX_OFFSET:
-- 
2.26.2


-- 

Roman Fietze
Entwicklungsingenieur
MAGNA Telemotive GmbH
Breitwiesen
73347 Mühlhausen
Tel.: +49 7335 18493-45




             reply	other threads:[~2020-06-24 12:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-24 12:15 Roman Fietze [this message]
2020-09-16 23:52 ` [PATCH] print_hex_dump: use %px when using DUMP_PREFIX_ADDRESS Timur Tabi

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=1946561.0luHp2vXsY@rfietze \
    --to=roman.fietze@magna.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.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