From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754723AbdLTJmE (ORCPT ); Wed, 20 Dec 2017 04:42:04 -0500 Received: from smtprelay0050.hostedemail.com ([216.40.44.50]:48367 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754235AbdLTJl7 (ORCPT ); Wed, 20 Dec 2017 04:41:59 -0500 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::,RULES_HIT:41:355:379:541:599:982:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3653:3865:3867:3868:4321:4605:5007:8784:8957:9038:10004:10400:10848:11026:11232:11473:11658:11914:12043:12296:12438:12679:12740:12760:12895:13069:13161:13229:13311:13357:13439:14181:14659:14721:21080:21451:21627:30054:30091,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: fork82_857628f109000 X-Filterd-Recvd-Size: 2177 Message-ID: <1513762915.1234.91.camel@perches.com> Subject: Re: [PATCH] checkpatch: add *_ON_STACK to $declaration_macros From: Joe Perches To: Gilad Ben-Yossef , Andy Whitcroft , linux-kernel@vger.kernel.org Cc: Ofir Drang , linux-crypto@vger.kernel.org Date: Wed, 20 Dec 2017 01:41:55 -0800 In-Reply-To: <1498550116-12475-1-git-send-email-gilad@benyossef.com> References: <1498550116-12475-1-git-send-email-gilad@benyossef.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.26.1-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2017-06-27 at 10:55 +0300, Gilad Ben-Yossef wrote: > Add the crypto API *_ON_STACK to $declaration_macros. > > Resolves the following false warning: > > WARNING: Missing a blank line after declarations > + int err; > + SHASH_DESC_ON_STACK(desc, ctx_p->shash_tfm); [] > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl [] > @@ -733,6 +733,7 @@ our $FuncArg = qr{$Typecast{0,1}($LvalOrFunc|$Constant|$String)}; > our $declaration_macros = qr{(?x: > (?:$Storage\s+)?(?:[A-Z_][A-Z0-9]*_){0,2}(?:DEFINE|DECLARE)(?:_[A-Z0-9]+){1,6}\s*\(| > (?:$Storage\s+)?LIST_HEAD\s*\(| > + (?:$Storage\s+)?[A-Z_]*_ON_STACK\(| A few things: The crypto _ON_STACK declarations cannot have a $Storage type. There should be a \s* between the ON_STACK and the open parenthesis There are other _ON_STACK types than the crypto uses $ grep -rP --include=*.[ch] -oh "\b[A-Z_]+_ON_STACK\b" * | \ sort | uniq -c | sort -rn 68 SKCIPHER_REQUEST_ON_STACK 45 SHASH_DESC_ON_STACK 10 AHASH_REQUEST_ON_STACK 4 PC_LOC_ON_STACK 4 DECLARE_DPM_WATCHDOG_ON_STACK 3 HISI_SAS_DECLARE_RST_WORK_ON_STACK 3 CONFIG_ARCH_TASK_STRUCT_ON_STACK 1 PT_SIZE_ON_STACK 1 ALLOC_PT_GPREGS_ON_STACK So perhaps: (?:SKCIPHER_REQUEST|SHASH_DESC|AHASH_REQUEST)_ON_STACK\s*\(