History

vsprintf: add printk specifier %px

printk specifier %p now hashes all addresses before printing. Sometimes we need to see the actual unmodified address. This can be achieved using %lx but then we face the risk that if in future we want to change the way the Kernel handles printing of pointers we will have to grep through the already existent 50 000 %lx call sites. Let's add specifier %px as a clear, opt-in, way to print a pointer and maintain some level of isolation from all the other hex integer output within the Kernel. Add printk specifier %px to print the actual unmodified address.

Tobin C. Harding committed 8 years ago

Commit 7b1924a1 parent ad67b743 files · +36 −2Browse files

Showing the changes to scripts/checkpatch.pl (1 of 3 files). Show all

Unified · Split

scripts/checkpatch.pl+1−1
@@ -5753,7 +5753,7 @@ sub process { · 5752 unmodified lines
57535753 for (my $count = $linenr; $count <= $lc; $count++) {
57545754 my $fmt = get_quoted_string($lines[$count - 1], raw_line($count, 0));
57555755 $fmt =~ s/%%//g;
5756− if ($fmt =~ /(\%[\*\d\.]*p(?![\WFfSsBKRraEhMmIiUDdgVCbGNO]).)/) {
5756+ if ($fmt =~ /(\%[\*\d\.]*p(?![\WFfSsBKRraEhMmIiUDdgVCbGNOx]).)/) {
57575757 $bad_extension = $1;
57585758 last;
57595759 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t