History

checkpatch: avoid "spaces required around that ':'" false positive

Since commit 1f65f947a6a8 ("checkpatch: add checks for question mark and colon spacing") back in 2008, checkpatch has reported false positive for asm volatile uses of "::" checkpatch thinks colons should always have spaces around it. Add an exception for colons with colons on either side for this valid asm volatile (and c++) use.

Joe Perches committed 11 years ago

Commit e0df7e11 parent 323b2671 file · +8 −0Browse files

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

Unified · Split

scripts/checkpatch.pl+8−0
@@ -3845,6 +3845,14 @@ sub process { · 3844 unmodified lines
38453845 $ok = 1;
38463846 }
38473847
3848+ # for asm volatile statements
3849+ # ignore a colon with another
3850+ # colon immediately before or after
3851+ if (($op eq ':') &&
3852+ ($ca =~ /:$/ || $cc =~ /^:/)) {
3853+ $ok = 1;
3854+ }
3855+
38483856 # messages are ERROR, but ?: are CHK
38493857 if ($ok == 0) {
38503858 my $msg_type = \&ERROR;

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