Ensure we do not report identifiers containing the word static as static declarations. For example this should not be reported as an unecessary assignement of 0: long nr_static = 0;
Showing the changes to scripts/checkpatch.pl (1 of 1 file). Show all
Unified · Split
| @@ -1632,7 +1632,7 @@ sub process { · 1631 unmodified lines | |||
| 1632 | $herecurr); | 1632 | $herecurr); |
| 1633 | } | 1633 | } |
| 1634 | # check for static initialisers. | 1634 | # check for static initialisers. |
| 1635 | if ($line =~ /\s*static\s.*=\s*(0|NULL|false)\s*;/) { | 1635 | if ($line =~ /\bstatic\s.*=\s*(0|NULL|false)\s*;/) { |
| 1636 | ERROR("do not initialise statics to 0 or NULL\n" . | 1636 | ERROR("do not initialise statics to 0 or NULL\n" . |
| 1637 | $herecurr); | 1637 | $herecurr); |
| 1638 | } | 1638 | } |