ntb: Use %p for pointer formatting
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
@@ -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
@@ -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
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.
Signed-off-by Sebastian Andrzej Siewior <[email protected]>
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@@ -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@@ -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);