mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Bruce Allan <bruce.w.allan@intel.com>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, Andy Whitcroft <apw@canonical.com>
Subject: Re: [PATCH] checkpatch: fix USLEEP_RANGE test
Date: Wed, 30 Jan 2013 20:55:07 -0800	[thread overview]
Message-ID: <1359608107.5255.5.camel@joe-AO722> (raw)
In-Reply-To: <20130130191530.27127.49640.stgit@bwallan-smackover2.jf.intel.com>

On Wed, 2013-01-30 at 11:15 -0800, Bruce Allan wrote:
> Do not test udelay() for a value less than 10usec when passed a variable
> instead of a hard-coded number;
[]
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
[]
> @@ -3237,9 +3237,9 @@ sub process {
[]
>  # prefer usleep_range over udelay
> -		if ($line =~ /\budelay\s*\(\s*(\w+)\s*\)/) {
> +		if ($line =~ /\budelay\s*\(\s*(\d+)\s*\)/) {
>  			# ignore udelay's < 10, however
> -			if (! (($1 =~ /(\d+)/) && ($1 < 10)) ) {
> +			if (! ($1 < 10) ) {
>  				CHK("USLEEP_RANGE",
>  				    "usleep_range is preferred over udelay; see Documentation/timers/timers-howto.txt\n" . $line);
>  			}

Thanks Bruce.

Just a trivial comment:

Maybe this would be a little neater as

		if ($line =~ \budelay\s*\(\s*(\d+)\s*\) &&
		    $1 >= 10) {
			CHK(etc...)
		}

No worries though.


      reply	other threads:[~2013-01-31  4:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-30 19:15 Bruce Allan
2013-01-31  4:55 ` Joe Perches [this message]

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=1359608107.5255.5.camel@joe-AO722 \
    --to=joe@perches.com \
    --cc=akpm@linux-foundation.org \
    --cc=apw@canonical.com \
    --cc=bruce.w.allan@intel.com \
    --cc=linux-kernel@vger.kernel.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®