Code Style issue

Kristofer Hallin kristofer.hallin at gmail.com
Sat Apr 5 03:07:03 EDT 2014


Short answer: Use pr_debug instead of printk.
On 5 Apr 2014 07:06, "HABI S RAVI" <habisbc at gmail.com> wrote:

> Hi,
> I am trying to fix a coding issue . I get the following warning when my
> module is checked with checkpatch.pl.
> How can i remove the warning. I see a lot of drivers using printk()
> function.
>
> $ perl ~/linux-stable/scripts/checkpatch.pl -f hello.c
> WARNING: Prefer netdev_dbg(netdev, ... then dev_dbg(dev, ... then
> pr_debug(...  to printk(KERN_DEBUG ...
> #6: FILE: hello.c:6:
> +       printk(KERN_DEBUG "Hello World!\n");
>
> WARNING: Prefer netdev_dbg(netdev, ... then dev_dbg(dev, ... then
> pr_debug(...  to printk(KERN_DEBUG ...
> #12: FILE: hello.c:12:
> +       printk(KERN_DEBUG "hello module unloaded\n");
>
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140405/0978baeb/attachment.html 


More information about the Kernelnewbies mailing list