]> git.baikalelectronics.ru Git - kernel.git/commit
checkpatch: warn on break after goto or return with same tab indentation
authorJoe Perches <joe@perches.com>
Wed, 6 Aug 2014 23:11:01 +0000 (16:11 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 7 Aug 2014 01:01:28 +0000 (18:01 -0700)
commit6c39ea8fa59c28542b3dd39f81e67895ac034502
treeffc146309723945fac34988eebd0d9a1f2284e53
parent2a85aa13acba69bcdf7cb3154d9f8e3c7a3d540a
checkpatch: warn on break after goto or return with same tab indentation

Using break; after a goto or return is unnecessary so emit a warning
when the break is at the same indent level.

So this emits a warning on:

switch (foo) {
case 1:
goto err;
break;
}

but not on:

switch (foo) {
case 1:
if (bar())
goto err;
break;
}

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
scripts/checkpatch.pl