<p dir="ltr">Short answer: Use pr_debug instead of printk.</p>
<div class="gmail_quote">On 5 Apr 2014 07:06, "HABI S RAVI" <<a href="mailto:habisbc@gmail.com">habisbc@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div>Hi,<br>I am trying to fix a coding issue . I get the following warning when my module is checked with <a href="http://checkpatch.pl" target="_blank">checkpatch.pl</a>.<br></div>How can i remove the warning. I see a lot of drivers using printk() function.<br>
<div><br>$ perl ~/linux-stable/scripts/<a href="http://checkpatch.pl" target="_blank">checkpatch.pl</a> -f hello.c<br><div>
WARNING: Prefer netdev_dbg(netdev, ... then dev_dbg(dev, ... then<br>
pr_debug(... to printk(KERN_DEBUG ...<br>
#6: FILE: hello.c:6:<br>
+ printk(KERN_DEBUG "Hello World!\n");<br>
<br>
WARNING: Prefer netdev_dbg(netdev, ... then dev_dbg(dev, ... then<br>
pr_debug(... to printk(KERN_DEBUG ...<br>
#12: FILE: hello.c:12:<br>
+ printk(KERN_DEBUG "hello module unloaded\n");<br>
</div><br></div></div>
<br>_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
<br></blockquote></div>