Skip to contentSkip to conversation

samples: rust_dma: add missing newline in dev_info! call

PATCH Superseded Ivan Borovyk 2 participants 3 messages Nov 23 – Nov 24

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

PATCH 1/1 samples: rust_dma: add missing newline in dev_info! call

The dev_info! call in the probe function lacks a trailing newline in its format string, which makes the message run together with the next line in the kernel log. Add the missing newline.

---
 samples/rust/rust_dma.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
samples/rust/rust_dma.rs +1 -1
index ffb693544673..b4b161896517 100644
@@ -129,7 +129,7 @@ fn drop(self: Pin<&mut Self>) {
         for (i, entry) in self.sgt.iter().enumerate() {
             dev_info!(
                 self.pdev,
-                "Entry[{}]: DMA address: {:#x}",
+                "Entry[{}]: DMA address: {:#x}\n",
                 i,
                 entry.dma_address(),
             );
Signature · 1 line
2.53.0
#1 lore raw

PATCH v2 1/1 samples: rust_dma: add missing newline in dev_info! call

The dev_info! call in PinnedDrop::drop() lacks a trailing newline in its format string, unlike the other dev_info!() calls in the file. End the format string with '\n' for consistency with the dev_*!() and pr_*!() macro conventions.

Fixes 5444799d701c ("samples: rust: dma: add sample code for SGTable")

---
Changes in v2:
- Correct the commit message: the modified call is in PinnedDrop::drop(), not in probe()
- Reword the rationale: consistency with the pr_*!()/dev_*!() macro conventions rather than log concatenation
- Add Fixes: tag

 samples/rust/rust_dma.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
samples/rust/rust_dma.rs +1 -1
index ffb693544673..b4b161896517 100644
@@ -129,7 +129,7 @@ fn drop(self: Pin<&mut Self>) {
         for (i, entry) in self.sgt.iter().enumerate() {
             dev_info!(
                 self.pdev,
-                "Entry[{}]: DMA address: {:#x}",
+                "Entry[{}]: DMA address: {:#x}\n",
                 i,
                 entry.dma_address(),
             );
Signature · 1 line
2.53.0
reviewer Reviewed-by on v2 1/1
#2 lore raw
Quoted 9 lines · Ivan Borovyk

The dev_info! call in PinnedDrop::drop() lacks a trailing newline in its format string, unlike the other dev_info!() calls in the file. End the format string with '\n' for consistency with the dev_*!() and pr_*!() macro conventions.

Fixes 5444799d701c ("samples: rust: dma: add sample code for SGTable")

FWIW,