Skip to contentSkip to conversation

misc: genwqe: Fix misuse of %x

PATCH Applied Fuqian Huang 2 participants 2 messages Apr 21, 2019 – Apr 23, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 3/6 misc: genwqe: Fix misuse of %x

The pointer should be printed with %p or %px rather than cast to long long type and printed with %016llx. Change %x to %p to print the pointer.

---
 drivers/misc/genwqe/card_debugfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/misc/genwqe/card_debugfs.c +2 -2
index 7c713e0..6f7e39f 100644
@@ -227,7 +227,7 @@ static int ddcb_info_show(struct seq_file *s, void *unused)
 	seq_puts(s, "DDCB QUEUE:\n");
 	seq_printf(s, "  ddcb_max:            %d\n"
 		   "  ddcb_daddr:          %016llx - %016llx\n"
-		   "  ddcb_vaddr:          %016llx\n"
+		   "  ddcb_vaddr:          %p\n"
 		   "  ddcbs_in_flight:     %u\n"
 		   "  ddcbs_max_in_flight: %u\n"
 		   "  ddcbs_completed:     %u\n"
@@ -237,7 +237,7 @@ static int ddcb_info_show(struct seq_file *s, void *unused)
 		   queue->ddcb_max, (long long)queue->ddcb_daddr,
 		   (long long)queue->ddcb_daddr +
 		   (queue->ddcb_max * DDCB_LENGTH),
-		   (long long)queue->ddcb_vaddr, queue->ddcbs_in_flight,
+		   queue->ddcb_vaddr, queue->ddcbs_in_flight,
 		   queue->ddcbs_max_in_flight, queue->ddcbs_completed,
 		   queue->return_on_busy, queue->wait_on_busy,
 		   cd->irqs_processed);
Signature · 1 line
2.11.0
maintainer
#1 lore raw
Quoted 6 lines · Fuqian Huang

The pointer should be printed with %p or %px rather than cast to long long type and printed with %016llx. Change %x to %p to print the pointer.

I would recommend to also use %pad for printing dma_addr_t if you do this.

Arnd