Skip to contentSkip to conversation

drivers: edac: This patch fix the following checkpatch warning.

PATCH In review Mohan Kumar 2 participants 3 messages Apr 14, 2019 1 message not in the archive

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

PATCH 1/1 drivers: edac: This patch fix the following checkpatch warning.

Use pr_warn instead of printk

WARNING: Prefer [subsystem eg: netdev]_err([subsystem]dev, ...

        then dev_err(dev, ... then pr_err(...  to printk(KERN_ERR ...
---
 drivers/edac/x38_edac.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/edac/x38_edac.c +3 -2
index cc779f3..4c855c0 100644
@@ -14,6 +14,7 @@
 #include <linux/pci.h>
 #include <linux/pci_ids.h>
 #include <linux/edac.h>
+#include <linux/netdevice.h>
 
 #include <linux/io-64-nonatomic-lo-hi.h>
 #include "edac_module.h"
@@ -260,7 +261,7 @@ static void __iomem *x38_map_mchbar(struct pci_dev *pdev)
 	u.mchbar &= X38_MCHBAR_MASK;
 
 	if (u.mchbar != (resource_size_t)u.mchbar) {
-		printk(KERN_ERR
+		pr_err(
 			"x38: mmio space beyond accessible range (0x%llx)\n",
 			(unsigned long long)u.mchbar);
 		return NULL;
@@ -268,7 +269,7 @@ static void __iomem *x38_map_mchbar(struct pci_dev *pdev)
 
 	window = ioremap_nocache(u.mchbar, X38_MMR_WINDOW_SIZE);
 	if (!window)
-		printk(KERN_ERR "x38: cannot map mmio space at 0x%llx\n",
+		pr_err("x38: cannot map mmio space at 0x%llx\n",
 			(unsigned long long)u.mchbar);
 
 	return window;
maintainer
#1 lore raw
Quoted 4 lines · Mohan Kumar

Use pr_warn instead of printk

WARNING: Prefer [subsystem eg: netdev]_err([subsystem]dev, ...

        then dev_err(dev, ... then pr_err(...  to printk(KERN_ERR ...

Please read this here first on what to put in your patch title and commit message:

https://www.kernel.org/doc/html/latest/process/submitting-patches.html

Quoted 18 lines
---
 drivers/edac/x38_edac.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/edac/x38_edac.c +1 -0
index cc779f3..4c855c0 100644
@@ -14,6 +14,7 @@
 #include <linux/pci.h>
 #include <linux/pci_ids.h>
 #include <linux/edac.h>
+#include <linux/netdevice.h>
 
 #include <linux/io-64-nonatomic-lo-hi.h>
 #include "edac_module.h"

drivers/edac/x38_edac.c static void __iomem *x38_map_mchbar(struct pci_dev *pdev) · line 265

Quoted 6 lines
drivers/edac/x38_edac.c +1 -1
@@ -260,7 +261,7 @@ static void __iomem *x38_map_mchbar(struct pci_dev *pdev)
 	u.mchbar &= X38_MCHBAR_MASK;
 
 	if (u.mchbar != (resource_size_t)u.mchbar) {
-		printk(KERN_ERR
+		pr_err(
 			"x38: mmio space beyond accessible range (0x%llx)\n",

Put those two on a single line so that you don't have an ugly linebreak like that.

Thx.

A message that is not in the archive (sent off-list or not yet received): CAKr-_Nj2=t-Oc3iNsnC9jBywftAwY8C6wMH+mdfiMPvgzdpYGA@mail.gmail.com

maintainer
#3 lore raw
Quoted 1 line · mohan kumar

Ok Thanks, I will do that.

Good.

One more thing: please do not top-post when replying on public mailing lists.

Thx.