mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Prakruthi Deepak Heragu <pheragu@codeaurora.org>,
	apw@canonical.com,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>
Cc: linux-kernel@vger.kernel.org, ckadabi@codeaurora.org,
	tsoni@codeaurora.org, bryanh@codeaurora.org
Subject: Re: [PATCH] checkpatch: Add exceptions for dsb keyword usage
Date: Thu, 05 Jul 2018 14:14:28 -0700	[thread overview]
Message-ID: <f3ce3ca8741f774b63e8a67a278384747b1de522.camel@perches.com> (raw)
In-Reply-To: <1530814776-16988-1-git-send-email-pheragu@codeaurora.org>

On Thu, 2018-07-05 at 11:19 -0700, Prakruthi Deepak Heragu wrote:
> mb() API can relpace the dsb() API in the kernel code. So, dsb() usage
> is discouraged. However, there are exceptions when dsb is used in a
> variable or a function name. Exceptions are when 'dsb' is prefixed with
> class [-_>*\.] and/or suffixed with class [-_\.;].
[]
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
[]
> @@ -5372,6 +5372,12 @@ sub process {
>  			     "Avoid line continuations in quoted strings\n" . $herecurr);
>  		}
>  
> +# dsb is too ARMish, and should usually be mb.
> +        if ($line =~ /[^-_>*\.]\bdsb\b[^-_\.;]/) {
> +            WARN("ARM_BARRIER",
> +                 "Use of dsb is discouranged: prefer mb.\n" .
> +                 $herecurr);
> +		}

This patch is whitespace damaged with a spelling error.

Also, if this is reasonable test, and I don't know
that it is, it should be cc'd to the linux-arm list
linux-arm-kernel@lists.infradead.org

Also, I suggest 2 tests, one for .S files and
another for .[ch] files, and this be made specific
to arch/arm... files

Something like:

	if ($realfile =~ @^arch/arm@ &&
	    ($realfile =~ /\.S$/ && $line =~ /\bdsb\b/) ||
	    ($realfile =~ /\.[ch]$/ && $line =~ /\bdsb\s*\(/)) {
		WARN("ARM_DSB",
		     "Prefer mb over dsb as an ARM memory barrier\n" . $herecurr);
	}

ARM people, is this reasonable?


  reply	other threads:[~2018-07-05 21:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-05 18:19 Prakruthi Deepak Heragu
2018-07-05 21:14 ` Joe Perches [this message]
2018-07-06  5:45   ` Mark Rutland
2018-07-06  5:52     ` Joe Perches
2018-07-06 17:00       ` pheragu
2018-07-06 17:02     ` pheragu

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=f3ce3ca8741f774b63e8a67a278384747b1de522.camel@perches.com \
    --to=joe@perches.com \
    --cc=apw@canonical.com \
    --cc=bryanh@codeaurora.org \
    --cc=ckadabi@codeaurora.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pheragu@codeaurora.org \
    --cc=tsoni@codeaurora.org \
    /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

all inboxes | Powered by JetHome®