summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2024-02-15 16:19:36 +0100
committerDonald Sharp <sharpd@nvidia.com>2024-03-04 17:03:46 +0100
commit852a74807fe1af51d69fd327156084b3e5d68fe4 (patch)
tree3ba3eb52aefeb16308bf6f9ec0574581096be56b /tools
parentMerge pull request #15467 from donaldsharp/bgp_best_selection_cleanup (diff)
downloadfrr-852a74807fe1af51d69fd327156084b3e5d68fe4.tar.xz
frr-852a74807fe1af51d69fd327156084b3e5d68fe4.zip
doc, tools: Remove ARRAY_SIZE check
checkpatch.pl wants you to use ARRAY_SIZE in a kernel header file. We don't have access to this kernel header file for normal compilation. I'm just going to remove it. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/checkpatch.pl13
1 files changed, 0 insertions, 13 deletions
diff --git a/tools/checkpatch.pl b/tools/checkpatch.pl
index ecae0e92a..f52f1a161 100755
--- a/tools/checkpatch.pl
+++ b/tools/checkpatch.pl
@@ -4656,19 +4656,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",