mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Gilad Ben-Yossef <gilad@benyossef.com>,
	Andy Whitcroft <apw@canonical.com>,
	linux-kernel@vger.kernel.org
Cc: Ofir Drang <ofir.drang@arm.com>, linux-crypto@vger.kernel.org
Subject: Re: [PATCH] checkpatch: add *_ON_STACK to $declaration_macros
Date: Wed, 20 Dec 2017 01:41:55 -0800	[thread overview]
Message-ID: <1513762915.1234.91.camel@perches.com> (raw)
In-Reply-To: <1498550116-12475-1-git-send-email-gilad@benyossef.com>

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*\(

  reply	other threads:[~2017-12-20  9:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-27  7:55 Gilad Ben-Yossef
2017-12-20  9:41 ` Joe Perches [this message]
2018-01-08  8:22   ` Gilad Ben-Yossef

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1513762915.1234.91.camel@perches.com \
    --to=joe@perches.com \
    --cc=apw@canonical.com \
    --cc=gilad@benyossef.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ofir.drang@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome