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

Commit 1bdab9e5 authored by Andy Whitcroft's avatar Andy Whitcroft Committed by Linus Torvalds
Browse files

checkpatch: switch indent allow plain return



It is a common and sane idiom to allow a single return on the end of a
case statement:

	switch (...) {
	case foo:	return bar;
	}

Add an exception for this.

Signed-off-by: default avatarAndy Whitcroft <apw@shadowen.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 14b111c1
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -1295,7 +1295,11 @@ sub process {
			}
		}
		if ($line =~ /^.\s*(?:case\s*.*|default\s*):/g &&
		    $line !~ /\G(?:\s*{)?(?:\s*$;*)(?:\s*\\)?\s*$/g) {
		    $line !~ /\G(?:
			(?:\s*{)?(?:\s*$;*)(?:\s*\\)?\s*$|
			\s*return\s+
		    )/xg)
		{
			ERROR("trailing statements should be on next line\n" . $herecurr);
		}