History

checkpatch: whinge about bool bitfields

Using bool in a bitfield isn't a good idea as the alignment behavior is arch implementation defined. Suggest using unsigned int or u<8|16|32> instead.

Joe Perches committed 8 years ago

Commit 5d430901 parent 38dca981 file · +6 −0Browse files

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

Unified · Split

scripts/checkpatch.pl+6−0
@@ -6251,6 +6251,12 @@ sub process { · 6250 unmodified lines
6251 }6251 }
6252 }6252 }
6253 6253
6254# check for bool bitfields
6255 if ($sline =~ /^.\s+bool\s*$Ident\s*:\s*\d+\s*;/) {
6256 WARN("BOOL_BITFIELD",
6257 "Avoid using bool as bitfield. Prefer bool bitfields as unsigned int or u<8|16|32>\n" . $herecurr);
6258 }
6259
6254# check for semaphores initialized locked6260# check for semaphores initialized locked
6255 if ($line =~ /^.\s*sema_init.+,\W?0\W?\)/) {6261 if ($line =~ /^.\s*sema_init.+,\W?0\W?\)/) {
6256 WARN("CONSIDER_COMPLETION",6262 WARN("CONSIDER_COMPLETION",

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