Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2c92488a authored by Joe Perches's avatar Joe Perches Committed by Linus Torvalds
Browse files

checkpatch: warn on use of yield()



Using yield() is generally wrong.  Warn on its use.

Signed-off-by: default avatarJoe Perches <joe@perches.com>
Cc: Andy Whitcroft <apw@canonical.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent aad4f614
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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",