diff options
author | Joe Perches <joe@perches.com> | 2012-03-23 18:02:20 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-23 19:58:37 -0400 |
commit | 2c92488ab29886d08766c054afc8dd0f19c724f1 (patch) | |
tree | c1a42d6c825de9b0f3bf239d9a1a086a4b4422ce /scripts/checkpatch.pl | |
parent | aad4f61498314d41d047ea2161b7bd7237b72d33 (diff) |
checkpatch: warn on use of yield()
Using yield() is generally wrong. Warn on its use.
Signed-off-by: Joe Perches <joe@perches.com>
Cc: Andy Whitcroft <apw@canonical.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts/checkpatch.pl')
-rwxr-xr-x | scripts/checkpatch.pl | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 21486c04b11c..d1fd466043ef 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -3338,6 +3338,12 @@ sub process { | |||
3338 | "__func__ should be used instead of gcc specific __FUNCTION__\n" . $herecurr); | 3338 | "__func__ should be used instead of gcc specific __FUNCTION__\n" . $herecurr); |
3339 | } | 3339 | } |
3340 | 3340 | ||
3341 | # check for use of yield() | ||
3342 | if ($line =~ /\byield\s*\(\s*\)/) { | ||
3343 | WARN("YIELD", | ||
3344 | "Using yield() is generally wrong. See yield() kernel-doc (sched/core.c)\n" . $herecurr); | ||
3345 | } | ||
3346 | |||
3341 | # check for semaphores initialized locked | 3347 | # check for semaphores initialized locked |
3342 | if ($line =~ /^.\s*sema_init.+,\W?0\W?\)/) { | 3348 | if ($line =~ /^.\s*sema_init.+,\W?0\W?\)/) { |
3343 | WARN("CONSIDER_COMPLETION", | 3349 | WARN("CONSIDER_COMPLETION", |