Skip to contentSkip to conversation

ntb: Use %p for pointer formatting

PATCH In review Sebastian Andrzej Siewior 2 participants 2 messages Sep 18 NTB driver core

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ntb: Use %p for pointer formatting

Since commit ad67b74d2469d ("printk: hash addresses printed with %p") pointers are hashed by default and the behaviour can be controller by `hash_pointers' boot argument.
The policy on %p is to not introduce new ones.
Removing %pK makes it possible to remove its handling from the library.

The usage here is restricted to debugfs and testing.

Use %p instead %pK.

---
 drivers/ntb/test/ntb_perf.c | 4 ++--
 drivers/ntb/test/ntb_tool.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/ntb/test/ntb_perf.c +2 -2
index dfd175f79e8f0..c4c572c754f18 100644
@@ -1222,7 +1222,7 @@ static ssize_t perf_dbgfs_read_info(struct file *filep, char __user *ubuf,
 			test_bit(PERF_STS_LNKUP, &peer->sts) ? "up" : "down");
 
 		pos += scnprintf(buf + pos, buf_size - pos,
-			"\tOut buffer addr 0x%pK\n", peer->outbuf);
+			"\tOut buffer addr 0x%p\n", peer->outbuf);
 
 		pos += scnprintf(buf + pos, buf_size - pos,
 			"\tOut buff phys addr %pap\n", &peer->out_phys_addr);
@@ -1240,7 +1240,7 @@ static ssize_t perf_dbgfs_read_info(struct file *filep, char __user *ubuf,
 		}
 
 		pos += scnprintf(buf + pos, buf_size - pos,
-			"\tIn buffer addr 0x%pK\n", peer->inbuf);
+			"\tIn buffer addr 0x%p\n", peer->inbuf);
 
 		pos += scnprintf(buf + pos, buf_size - pos,
 			"\tIn buffer size %pa\n", &peer->inbuf_size);
drivers/ntb/test/ntb_tool.c +2 -2
index 06881047f5bcd..63d830924ae91 100644
@@ -666,7 +666,7 @@ static ssize_t tool_mw_trans_read(struct file *filep, char __user *ubuf,
 			 inmw->pidx);
 
 	off += scnprintf(buf + off, buf_size - off,
-			 "Window Address \t0x%pK\n", inmw->mm_base);
+			 "Window Address \t0x%p\n", inmw->mm_base);
 
 	off += scnprintf(buf + off, buf_size - off,
 			 "DMA Address    \t%pad\n",
@@ -899,7 +899,7 @@ static ssize_t tool_peer_mw_trans_read(struct file *filep, char __user *ubuf,
 	}
 
 	off += scnprintf(buf + off, buf_size - off,
-			 "Virtual address     \t0x%pK\n", outmw->io_base);
+			 "Virtual address     \t0x%p\n", outmw->io_base);
 
 	off += scnprintf(buf + off, buf_size - off,
 			 "Phys Address        \t%pap\n", &map_base);
Signature · 1 line
2.55.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Sebastian Andrzej Siewior

Since commit ad67b74d2469d ("printk: hash addresses printed with %p") pointers are hashed by default and the behaviour can be controller by `hash_pointers' boot argument.
The policy on %p is to not introduce new ones.
Removing %pK makes it possible to remove its handling from the library.

The usage here is restricted to debugfs and testing.

Use %p instead %pK.

Quoted 49 lines
---
 drivers/ntb/test/ntb_perf.c | 4 ++--
 drivers/ntb/test/ntb_tool.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/ntb/test/ntb_perf.c +2 -2
index dfd175f79e8f0..c4c572c754f18 100644
@@ -1222,7 +1222,7 @@ static ssize_t perf_dbgfs_read_info(struct file *filep, char __user *ubuf,
 			test_bit(PERF_STS_LNKUP, &peer->sts) ? "up" : "down");
 
 		pos += scnprintf(buf + pos, buf_size - pos,
-			"\tOut buffer addr 0x%pK\n", peer->outbuf);
+			"\tOut buffer addr 0x%p\n", peer->outbuf);
 
 		pos += scnprintf(buf + pos, buf_size - pos,
 			"\tOut buff phys addr %pap\n", &peer->out_phys_addr);
@@ -1240,7 +1240,7 @@ static ssize_t perf_dbgfs_read_info(struct file *filep, char __user *ubuf,
 		}
 
 		pos += scnprintf(buf + pos, buf_size - pos,
-			"\tIn buffer addr 0x%pK\n", peer->inbuf);
+			"\tIn buffer addr 0x%p\n", peer->inbuf);
 
 		pos += scnprintf(buf + pos, buf_size - pos,
 			"\tIn buffer size %pa\n", &peer->inbuf_size);
drivers/ntb/test/ntb_tool.c +2 -2
index 06881047f5bcd..63d830924ae91 100644
@@ -666,7 +666,7 @@ static ssize_t tool_mw_trans_read(struct file *filep, char __user *ubuf,
 			 inmw->pidx);
 
 	off += scnprintf(buf + off, buf_size - off,
-			 "Window Address \t0x%pK\n", inmw->mm_base);
+			 "Window Address \t0x%p\n", inmw->mm_base);
 
 	off += scnprintf(buf + off, buf_size - off,
 			 "DMA Address    \t%pad\n",
@@ -899,7 +899,7 @@ static ssize_t tool_peer_mw_trans_read(struct file *filep, char __user *ubuf,
 	}
 
 	off += scnprintf(buf + off, buf_size - off,
-			 "Virtual address     \t0x%pK\n", outmw->io_base);
+			 "Virtual address     \t0x%p\n", outmw->io_base);
 
 	off += scnprintf(buf + off, buf_size - off,
 			 "Phys Address        \t%pap\n", &map_base);