Skip to contentSkip to conversation

dmaengine: loongson: Use %p for pointer formatting

PATCH In review Sebastian Andrzej Siewior 2 participants 4 messages Sep 18

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

PATCH 1/1 dmaengine: loongson: Use %p for pointer formatting

The %pK format modifier was meant for /proc kind of output, not general printk output. 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. This is the only pointer output in the driver.

Remove the pointer formating from debug output.

---
 drivers/dma/loongson/loongson2-apb-cmc-dma.c | 1 -
 1 file changed, 1 deletion(-)
drivers/dma/loongson/loongson2-apb-cmc-dma.c +0 -1
index 1c9a542edc859..27f8f7a5738d9 100644
@@ -337,7 +337,6 @@ static void loongson2_cmc_dma_issue_pending(struct dma_chan *chan)
 	guard(spinlock_irqsave)(&lchan->vchan.lock);
 
 	if (vchan_issue_pending(&lchan->vchan) && !lchan->desc) {
-		dev_dbg(chan2dev(lchan), "vchan %pK: issued\n", &lchan->vchan);
 		loongson2_cmc_dma_start_transfer(lchan);
 	}
 }
Signature · 1 line
2.55.0
#1 lore raw
Quoted 19 lines · Sebastian Andrzej Siewior

The %pK format modifier was meant for /proc kind of output, not general printk output. 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. This is the only pointer output in the driver.

Remove the pointer formating from debug output.

---
 drivers/dma/loongson/loongson2-apb-cmc-dma.c | 1 -
 1 file changed, 1 deletion(-)
drivers/dma/loongson/loongson2-apb-cmc-dma.c +0 -0
index 1c9a542edc859..27f8f7a5738d9 100644

drivers/dma/loongson/loongson2-apb-cmc-dma.c static void loongson2_cmc_dma_issue_pending(struct dma_chan *chan) · line 340

Quoted 4 lines
drivers/dma/loongson/loongson2-apb-cmc-dma.c +0 -1
@@ -337,7 +337,6 @@ static void loongson2_cmc_dma_issue_pending(struct dma_chan *chan)
 	guard(spinlock_irqsave)(&lchan->vchan.lock);
 
 	if (vchan_issue_pending(&lchan->vchan) && !lchan->desc) {
-		dev_dbg(chan2dev(lchan), "vchan %pK: issued\n", &lchan->vchan);

You remove whole dev_dbg(), but commit message said Use %p

Frank

Quoted 6 lines
drivers/dma/loongson/loongson2-apb-cmc-dma.c +0 -1
 		loongson2_cmc_dma_start_transfer(lchan);
 	}
 }
--

2.55.0

#2 lore raw
Quoted 22 lines · Frank Li
Quoted 21 lines · Sebastian Andrzej Siewior

The %pK format modifier was meant for /proc kind of output, not general printk output. 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. This is the only pointer output in the driver.

Remove the pointer formating from debug output.

---
 drivers/dma/loongson/loongson2-apb-cmc-dma.c | 1 -
 1 file changed, 1 deletion(-)
drivers/dma/loongson/loongson2-apb-cmc-dma.c +0 -0
index 1c9a542edc859..27f8f7a5738d9 100644
@@ -337,7 +337,6 @@ static void loongson2_cmc_dma_issue_pending(struct dma_chan *chan)
 	guard(spinlock_irqsave)(&lchan->vchan.lock);
 
Quoted 4 lines

drivers/dma/loongson/loongson2-apb-cmc-dma.c static void loongson2_cmc_dma_issue_pending(struct dma_chan *chan) · line 340

Quoted 2 lines
drivers/dma/loongson/loongson2-apb-cmc-dma.c +0 -1
 	if (vchan_issue_pending(&lchan->vchan) && !lchan->desc) {
-		dev_dbg(chan2dev(lchan), "vchan %pK: issued\n", &lchan->vchan);

You remove whole dev_dbg(), but commit message said Use %p

I redid based on feedback before submitting and forgot to update the subject. Are you fine with removing it?

Quoted 4 lines

Frank

Quoted 3 lines
drivers/dma/loongson/loongson2-apb-cmc-dma.c +0 -0
 		loongson2_cmc_dma_start_transfer(lchan);
 	}
 }

Sebastian

#3 lore raw
Quoted 23 lines · Sebastian Andrzej Siewior
Quoted 22 lines · Frank Li
Quoted 21 lines · Sebastian Andrzej Siewior

The %pK format modifier was meant for /proc kind of output, not general printk output. 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. This is the only pointer output in the driver.

Remove the pointer formating from debug output.

---
 drivers/dma/loongson/loongson2-apb-cmc-dma.c | 1 -
 1 file changed, 1 deletion(-)
drivers/dma/loongson/loongson2-apb-cmc-dma.c +0 -0
index 1c9a542edc859..27f8f7a5738d9 100644
@@ -337,7 +337,6 @@ static void loongson2_cmc_dma_issue_pending(struct dma_chan *chan)
 	guard(spinlock_irqsave)(&lchan->vchan.lock);
 
Quoted 7 lines
Quoted 4 lines

drivers/dma/loongson/loongson2-apb-cmc-dma.c static void loongson2_cmc_dma_issue_pending(struct dma_chan *chan) · line 340

Quoted 2 lines
drivers/dma/loongson/loongson2-apb-cmc-dma.c +0 -1
 	if (vchan_issue_pending(&lchan->vchan) && !lchan->desc) {
-		dev_dbg(chan2dev(lchan), "vchan %pK: issued\n", &lchan->vchan);

You remove whole dev_dbg(), but commit message said Use %p

I redid based on feedback before submitting and forgot to update the subject. Are you fine with removing it?

I am fine to remove it.

Frank

Quoted 7 lines
Quoted 5 lines

Frank

Quoted 3 lines
drivers/dma/loongson/loongson2-apb-cmc-dma.c +0 -0
 		loongson2_cmc_dma_start_transfer(lchan);
 	}
 }

Sebastian