From 2c92488ab29886d08766c054afc8dd0f19c724f1 Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Fri, 23 Mar 2012 15:02:20 -0700 Subject: [PATCH] checkpatch: warn on use of yield() Using yield() is generally wrong. Warn on its use. Signed-off-by: Joe Perches Cc: Andy Whitcroft Cc: Peter Zijlstra Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- scripts/checkpatch.pl | 6 ++++++ 1 file changed, 6 insertions(+) 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 { "__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", -- 2.20.1