public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sergey Dyasly <dserrg@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Sergey Dyasly <dserrg@gmail.com>, Oleg Nesterov <oleg@redhat.com>,
	Andy Whitcroft <apw@canonical.com>, Joe Perches <joe@perches.com>
Subject: [PATCH v2] checkpatch: add check for the buggy while_each_thread()
Date: Wed, 21 Jan 2015 20:01:22 +0300	[thread overview]
Message-ID: <1421859682-7047-1-git-send-email-dserrg@gmail.com> (raw)

Now it's preferable to use for_each_thread() instead of while_each_thread().
Add a check to checkpatch.pl in order to prevent any new usages of the buggy
while_each_thread() when possible.

Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Andy Whitcroft <apw@canonical.com>
Cc: Joe Perches <joe@perches.com>
Signed-off-by: Sergey Dyasly <dserrg@gmail.com>
---
Changes since v1:
- Added "\s*" to the regular expression
- Limited commit id to 12 digits
- "Prefer to use" --> "Consider using"
- Moved check to the end of the file

 scripts/checkpatch.pl | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index f0bb6d6..d48f7b2 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -5259,6 +5259,12 @@ sub process {
 				}
 			}
 		}
+
+# Check for the buggy while_each_thread()
+		if ($line =~ /\bwhile_each_thread\s*\(/) {
+			WARN("WHILE_EACH_THREAD",
+			     "Consider using for_each_thread() instead of the buggy while_each_thread(). See commit 0c740d0afc3b for details.\n" . $herecurr);
+		}
 	}
 
 	# If we have no input at all, then there is nothing to report on
-- 
2.2.2


                 reply	other threads:[~2015-01-21 17:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1421859682-7047-1-git-send-email-dserrg@gmail.com \
    --to=dserrg@gmail.com \
    --cc=apw@canonical.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg@redhat.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