All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] checkpatch: add warning on %pk instead of %pK usage
@ 2017-02-10 19:37 ` william.c.roberts
  0 siblings, 0 replies; 50+ messages in thread
From: william.c.roberts @ 2017-02-10 19:37 UTC (permalink / raw)
  To: linux-kernel, joe, apw; +Cc: keescook, kernel-hardening, William Roberts

From: William Roberts <william.c.roberts@intel.com>

Sample output:
WARNING: %pk is close to %pK, did you mean %pK?.
\#20: FILE: drivers/char/applicom.c:230:
+			printk(KERN_INFO "Could not allocate IRQ %d for PCI Applicom device. %pk\n", dev->irq, pci_get_class);

Signed-off-by: William Roberts <william.c.roberts@intel.com>
---
 scripts/checkpatch.pl | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 982c52c..f20f5c5 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -6096,6 +6096,12 @@ sub process {
 			      "recursive locking is bad, do not use this ever.\n" . $herecurr);
 		}
 
+# check for bad %pK usage
+		if ($rawline =~ /\%pk/) {
+			WARN("FORMAT SPECIFIER",
+			      "%pk is close to %pK, did you mean %pK?.\n" . $herecurr);
+		}
+
 # check for lockdep_set_novalidate_class
 		if ($line =~ /^.\s*lockdep_set_novalidate_class\s*\(/ ||
 		    $line =~ /__lockdep_no_validate__\s*\)/ ) {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 50+ messages in thread

end of thread, other threads:[~2017-03-01  2:01 UTC | newest]

Thread overview: 50+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-10 19:37 [PATCH] checkpatch: add warning on %pk instead of %pK usage william.c.roberts
2017-02-10 19:37 ` [kernel-hardening] " william.c.roberts
2017-02-10 20:12 ` Joe Perches
2017-02-10 20:12   ` [kernel-hardening] " Joe Perches
2017-02-10 22:14   ` Roberts, William C
2017-02-10 22:14     ` [kernel-hardening] " Roberts, William C
2017-02-10 22:26     ` Roberts, William C
2017-02-10 22:26       ` [kernel-hardening] " Roberts, William C
2017-02-10 22:49       ` Joe Perches
2017-02-10 22:49         ` [kernel-hardening] " Joe Perches
2017-02-10 22:59         ` Joe Perches
2017-02-10 22:59           ` [kernel-hardening] " Joe Perches
2017-02-10 23:31         ` Roberts, William C
2017-02-10 23:31           ` [kernel-hardening] " Roberts, William C
2017-02-10 23:49           ` Joe Perches
2017-02-10 23:49             ` [kernel-hardening] " Joe Perches
2017-02-10 23:54         ` Roberts, William C
2017-02-10 23:54           ` [kernel-hardening] " Roberts, William C
2017-02-11  0:01           ` Joe Perches
2017-02-11  0:01             ` [kernel-hardening] " Joe Perches
2017-02-11  1:32         ` Roberts, William C
2017-02-11  1:32           ` [kernel-hardening] " Roberts, William C
2017-02-11  3:23           ` Joe Perches
2017-02-11  3:23             ` [kernel-hardening] " Joe Perches
2017-02-13 19:46             ` Roberts, William C
2017-02-13 19:46               ` [kernel-hardening] " Roberts, William C
2017-02-13 20:14               ` Joe Perches
2017-02-13 20:14                 ` [kernel-hardening] " Joe Perches
     [not found]               ` <1487016251.6214.6.camel@perches.com>
     [not found]                 ` <476DC76E7D1DF2438D32BFADF679FC562305F62F@ORSMSX103.amr.corp.intel.com>
2017-02-13 22:20                   ` Joe Perches
2017-02-13 22:20                     ` [kernel-hardening] " Joe Perches
2017-02-15 23:49                     ` Roberts, William C
2017-02-15 23:49                       ` [kernel-hardening] " Roberts, William C
2017-02-16  0:19                       ` Joe Perches
2017-02-16  0:19                         ` [kernel-hardening] " Joe Perches
2017-02-27 16:26                       ` Roberts, William C
2017-02-27 16:26                         ` [kernel-hardening] " Roberts, William C
2017-02-27 20:54                         ` [PATCH] checkpatch: Add ability to find bad uses of vsprintf %p<foo> extensions Joe Perches
2017-02-27 20:54                           ` [kernel-hardening] " Joe Perches
2017-02-27 21:18                           ` Kees Cook
2017-02-27 21:18                             ` Kees Cook
2017-02-28 15:34                           ` Roberts, William C
2017-02-28 15:34                             ` [kernel-hardening] " Roberts, William C
2017-03-01  0:06                           ` Andrew Morton
2017-03-01  0:06                             ` [kernel-hardening] " Andrew Morton
2017-03-01  0:11                             ` Kees Cook
2017-03-01  0:11                               ` Kees Cook
2017-03-01  1:14                               ` Joe Perches
2017-03-01  1:14                                 ` Joe Perches
2017-03-01  0:12                             ` Joe Perches
2017-03-01  0:12                               ` [kernel-hardening] " Joe Perches

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.