lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 2 Mar 2014 14:13:03 +0530
From:	Yogesh Chaudhari <mr.yogesh@...il.com>
To:	LKML <linux-kernel@...r.kernel.org>
Subject: scripts/checkpatch.pl

Hello,

I recently ran "scripts/checkpatch.pl" after adding the simplest form
of "hello world" module to the source tree. I used the old "printk"s
in this module and got this warning message:

WARNING: Prefer netdev_dbg(netdev, ... then dev_dbg(dev, ... then
pr_debug(...  to printk(KERN_DEBUG ...

It has come to my understanding that the dynamic debugging interface
offered by pr_debug and dev_dbg have obvious advantages to printk and
therefore they are preferred to printk.

Even amongst dev_dbg and pr_debug, we prefer dev_dbg if we have a
struct device to standardize device information output along with our
debug message. It offers escape from the "edit/rebuild/reboot cycle"
and also allows to maintain a neat log through dynamic_debug/control
interface.

I was not clear as to why netdev_dbg would be preferred to dev_dbg and
was given this asnwer on stackoverflow:

http://stackoverflow.com/questions/22077540/order-of-preference-printk-vs-dev-dbg-vs-netdev-dbg

Particularly, in regards to this part:
"netdev_dbg it is not the absolutly prefered print style. It is
prefered if you are working with a netdevice."

If this is the case, then I think the WARNING message should be
modified to mention that [subsystem]_dbg is preferred over dev_dbg. In
case this is correct and I am not missing something, I would like to
propose a patch to modify this script to give appropriate error
message. But in case I am wrong about this I would like
comments/suggestions/explanations before starting anything.

Thanks
Yogesh
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ