[PATCH] checkpatch: Remove preference for alloc(sizeof(*p), ...)

From: Joe Perches
Date: Mon May 22 2017 - 17:50:07 EST


This style has some negatives and positives and is not univerally
accepted so checkpatch should not warn on it one way or another.

Signed-off-by: Joe Perches <joe@xxxxxxxxxxx>
---
 scripts/checkpatch.pl | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 5b0f57fce9b8..ba45638555d4 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -5927,14 +5927,6 @@ sub process {
       "unnecessary cast may hide bugs, see http://c-faq.com/malloc/mallocnocast.html\n"; . $herecurr);
  }
 
-# alloc style
-# p = alloc(sizeof(struct foo), ...) should be p = alloc(sizeof(*p), ...)
- if ($^V && $^V ge 5.10.0 &&
-     $line =~ /\b($Lval)\s*\=\s*(?:$balanced_parens)?\s*([kv][mz]alloc(?:_node)?)\s*\(\s*(sizeof\s*\(\s*struct\s+$Lval\s*\))/) {
- CHK("ALLOC_SIZEOF_STRUCT",
-     "Prefer $3(sizeof(*$1)...) over $3($4...)\n" . $herecurr);
- }
-
 # check for k[mz]alloc with multiplies that could be kmalloc_array/kcalloc
  if ($^V && $^V ge 5.10.0 &&
      defined $stat &&
-- 
2.10.0.rc2.1.g053435c