Skip to content

Commit

Permalink
Removed ARRAY_SIZE check (Kernel macro)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandre Gautier committed Feb 18, 2017
1 parent ee1c16f commit 69cb2e6
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions betty-style.pl
Original file line number Diff line number Diff line change
Expand Up @@ -3646,19 +3646,6 @@ sub process {
$herecurr);
}

# check for sizeof(foo)/sizeof(foo[0]) that could be ARRAY_SIZE(foo)
if ($line =~ m@\bsizeof\s*\(\s*($Lval)\s*\)@) {
my $array = $1;
if ($line =~ m@\b(sizeof\s*\(\s*\Q$array\E\s*\)\s*/\s*sizeof\s*\(\s*\Q$array\E\s*\[\s*0\s*\]\s*\))@) {
my $array_div = $1;
if (WARN("ARRAY_SIZE",
"Prefer ARRAY_SIZE($array)\n" . $herecurr) &&
$fix) {
$fixed[$fixlinenr] =~ s/\Q$array_div\E/ARRAY_SIZE($array)/;
}
}
}

# check for function declarations without arguments like "int foo()"
if ($line =~ /(\b$Type\s+$Ident)\s*\(\s*\)/) {
if (ERROR("FUNCTION_WITHOUT_ARGS",
Expand Down

0 comments on commit 69cb2e6

Please sign in to comment.