Skip to contentSkip to conversation

staging: sm750fb: Replace printk() with pr_info().

PATCH In review Elise Lennion 2 participants 3 messages Oct 9, 2016 – Oct 11, 2016

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

PATCH v4 1/1 staging: sm750fb: Replace printk() with pr_info().

Fix checkpatch warning:

WARNING: printk() should include KERN_ facility level

New checkpatch warning appears after including KERN_ facility level.

Fix checkpatch warning:

WARNING: Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then dev_info(dev, ... then pr_info(... to printk(KERN_INFO ...

---
 drivers/staging/sm750fb/ddk750_help.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/sm750fb/ddk750_help.c +1 -1
index 9637dd3..e72a29c 100644
@@ -11,7 +11,7 @@ void ddk750_set_mmio(void __iomem *addr, unsigned short devId, char revId)
 	devId750 = devId;
 	revId750 = revId;
 	if (revId == 0xfe)
-		printk("found sm750le\n");
+		pr_info("found sm750le\n");
 }
 
 
Signature · 1 line
2.7.4
maintainer
#1 lore raw
Quoted 20 lines · Elise Lennion

Fix checkpatch warning:

WARNING: printk() should include KERN_ facility level

New checkpatch warning appears after including KERN_ facility level.

Fix checkpatch warning:

WARNING: Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then dev_info(dev, ... then pr_info(... to printk(KERN_INFO ...

---
 drivers/staging/sm750fb/ddk750_help.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/sm750fb/ddk750_help.c +0 -0
index 9637dd3..e72a29c 100644

drivers/staging/sm750fb/ddk750_help.c void ddk750_set_mmio(void __iomem *addr, unsigned short devId, char revId) · line 15

Quoted 6 lines
drivers/staging/sm750fb/ddk750_help.c +1 -1
@@ -11,7 +11,7 @@ void ddk750_set_mmio(void __iomem *addr, unsigned short devId, char revId)
 	devId750 = devId;
 	revId750 = revId;
 	if (revId == 0xfe)
-		printk("found sm750le\n");
+		pr_info("found sm750le\n");
 }

In looking at this further, this is a horrid function. And it's not even needed to be in a separate file. Please merge it into the ddk750_chip.c, which will allow you to make the variables in this file static at the same time.

I'll take this patch now, but future cleanups would be great.

thanks,

greg k-h

#2 lore raw
Quoted 5 lines

In looking at this further, this is a horrid function. And it's not even needed to be in a separate file. Please merge it into the ddk750_chip.c, which will allow you to make the variables in this file static at the same time.

I think I didn't understand which variables should be static.

The variables in ddk750_help.c are globals declared in ddk750_help.h.

They must be global because many files use the macros PEEK32() and POKE32(), declared in ddk750_help.h, that use them.

If they become static their value will be seen only in ddk750_chip.c and the macros will stop working.

Did I miss something? Which variables should be static?

Quoted 6 lines

I'll take this patch now, but future cleanups would be great.

thanks,

greg k-h

I merged the files in a new patch:
https://groups.google.com/forum/#!topic/outreachy-kernel/LOg5mXl7--s.

thank you,

elise