lkml.org 
[lkml]   [2012]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/2] checkpatch: Warn on use of yield()
Date
Using yield() is generally wrong.  Warn on its use.

Signed-off-by: Joe Perches <joe@perches.com>
---
scripts/checkpatch.pl | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 04eb9eb..135cb8f 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3344,6 +3344,12 @@ sub process {
"__func__ should be used instead of gcc specific __FUNCTION__\n" . $herecurr);
}

+# check for use of yield()
+ if ($line =~ /\byield\s*\(\s*\)/ {
+ WARN("YIELD",
+ "Using yield() is generally wrong. See yield() kernel-doc (sched/core.c)\n" . $herecurr);
+ }
+
# check for semaphores initialized locked
if ($line =~ /^.\s*sema_init.+,\W?0\W?\)/) {
WARN("CONSIDER_COMPLETION",
--
1.7.8.111.gad25c.dirty


\
 
 \ /
  Last update: 2012-03-06 20:33    [W:0.053 / U:1.288 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site