From: Joe Perches Date: Fri, 23 Mar 2012 22:02:20 +0000 (-0700) Subject: checkpatch: warn on use of yield() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2c92488ab29886d08766c054afc8dd0f19c724f1;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 --- 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",