* [PATCH] mm/dmapool_test: replace printk with pr_info/err
@ 2024-10-14 18:35 Pintu Kumar
0 siblings, 0 replies; only message in thread
From: Pintu Kumar @ 2024-10-14 18:35 UTC (permalink / raw)
To: akpm, linux-mm, linux-kernel; +Cc: skhan, pintu.ping, Pintu Kumar
Add SPDX license header and use correct pr_info/err.
These warnings are reported by checkpatch.
This makes the style clean.
WARNING: Missing or malformed SPDX-License-Identifier tag in line 1
+#include <linux/device.h>
WARNING: printk() should include KERN_<LEVEL> facility level
+ printk("dmapool test: size:%-4zu align:%-4zu blocks:%-4d time:%llu\n",
[...]
Signed-off-by: Pintu Kumar <quic_pintu@quicinc.com>
---
mm/dmapool_test.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/mm/dmapool_test.c b/mm/dmapool_test.c
index 54b1fd1ccfbb..99269e37ca59 100644
--- a/mm/dmapool_test.c
+++ b/mm/dmapool_test.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: GPL-2.0-only
+
#include <linux/device.h>
#include <linux/dma-map-ops.h>
#include <linux/dma-mapping.h>
@@ -87,7 +89,7 @@ static int dmapool_test_block(const struct dmapool_parms *parms)
}
end_time = ktime_get();
- printk("dmapool test: size:%-4zu align:%-4zu blocks:%-4d time:%llu\n",
+ pr_info("dmapool test: size:%-4zu align:%-4zu blocks:%-4d time:%llu\n",
parms->size, parms->align, blocks,
ktime_us_delta(end_time, start_time));
@@ -112,7 +114,7 @@ static int dmapool_checks(void)
ret = device_register(&test_dev);
if (ret) {
- printk("%s: register failed:%d\n", __func__, ret);
+ pr_err("%s: register failed:%d\n", __func__, ret);
goto put_device;
}
@@ -121,7 +123,7 @@ static int dmapool_checks(void)
test_dev.dma_mask = &dma_mask;
ret = dma_set_mask_and_coherent(&test_dev, DMA_BIT_MASK(64));
if (ret) {
- printk("%s: mask failed:%d\n", __func__, ret);
+ pr_err("%s: mask failed:%d\n", __func__, ret);
goto del_device;
}
--
2.17.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-10-14 18:36 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-14 18:35 [PATCH] mm/dmapool_test: replace printk with pr_info/err Pintu Kumar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox