From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965184AbdEVVuB (ORCPT ); Mon, 22 May 2017 17:50:01 -0400 Received: from smtprelay0227.hostedemail.com ([216.40.44.227]:41798 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965164AbdEVVtv (ORCPT ); Mon, 22 May 2017 17:49:51 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 50,0,0,,d41d8cd98f00b204,joe@perches.com,:::::,RULES_HIT:41:355:379:541:800:901:960:967:973:982:988:989:1260:1263:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2197:2199:2393:2525:2553:2560:2563:2682:2685:2828:2859:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3352:3653:3868:3871:3872:3874:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4321:5007:7904:8599:9025:9388:9592:10004:10400:10848:11026:11232:11473:11658:11783:11854:11914:12043:12555:12776:12895:12986:13069:13311:13357:13439:13894:14094:14181:14394:14651:14659:14721:21080:21221:21451:21627:30054:30070:30090,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: hands26_72ed584318608 X-Filterd-Recvd-Size: 1816 Message-ID: <1495489788.2093.52.camel@perches.com> Subject: [PATCH] checkpatch: Remove preference for alloc(sizeof(*p), ...) From: Joe Perches To: Alexey Dobriyan , akpm@linux-foundation.org Cc: linux-kernel@vger.kernel.org Date: Mon, 22 May 2017 14:49:48 -0700 In-Reply-To: <20170522213837.GA13861@avx2> References: <20170522213837.GA13861@avx2> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.22.6-1ubuntu1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 ---  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