checkpatch-improve-tests-for-multiple-line-function-definitions.patch removed from -mm tree
The patch titled
Subject: checkpatch: improve tests for multiple line function definitions
has been removed from the -mm tree. Its filename was
checkpatch-improve-tests-for-multiple-line-function-definitions.patch
This patch was dropped because it was merged into mainline or a subsystem tree
------------------------------------------------------
From: Joe Perches <[email protected]>
Subject: checkpatch: improve tests for multiple line function definitions
Add a block that identifies multiple line function definitions.
Save the function name into $context_function to improve the embedded function name test.
Look for misplaced open brace on the function definition. Emit an OPEN_BRACE error when the function definition is similar to
void foo(int arg1,
int arg2) {
Miscellanea:
o Remove the $realfile test in function declaration w/o named arguments test
o Comment the function declaration w/o named arguments test
---
scripts/checkpatch.pl | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-)
scripts/checkpatch.pl renamed from scripts/checkpatch.pl~checkpatch-improve-tests-for-multiple-line-function-definitions +25 -1
@@ -5899,7 +5899,8 @@ sub process { "externs should be avoided in .c files\n" . $herecurr); } - if ($realfile =~ /\.[ch]$/ && defined $stat && +# check for function declarations that have arguments without identifier names + if (defined $stat && $stat =~ /^.\s*(?:extern\s+)?$Type\s*$Ident\s*\(\s*([^{]+)\s*\)\s*;/s && $1 ne "void") { my $args = trim($1);
@@ -5912,6 +5913,29 @@ sub process { } } +# check for function definitions + if ($^V && $^V ge 5.10.0 && + defined $stat && + $stat =~ /^.\s*(?:$Storage\s+)?$Type\s*($Ident)\s*$balanced_parens\s*{/s) { + $context_function = $1; + +# check for multiline function definition with misplaced open brace + my $ok = 0; + my $cnt = statement_rawlines($stat); + my $herectx = $here . "\n"; + for (my $n = 0; $n < $cnt; $n++) { + my $rl = raw_line($linenr, $n); + $herectx .= $rl . "\n"; + $ok = 1 if ($rl =~ /^[ \+]\{/); + $ok = 1 if ($rl =~ /\{/ && $n == 0); + last if $rl =~ /^[ \+].*\{/; + } + if (!$ok) { + ERROR("OPEN_BRACE", + "open brace '{' following function definitions go on the next line\n" . $herectx); + } + } + # checks for new __setup's if ($rawline =~ /\b__setup\("([^"]*)"/) { my $name = $1;
_
Patches currently in -mm which might be from [email protected] are
checkpatch-improve-the-storage_class-test.patch arm-kvm-move-asmlinkage-before-type.patch arm-hp-jornada-7xx-move-inline-before-return-type.patch cris-gpio-move-inline-before-return-type.patch frv-tlbflush-move-asmlinkage-before-return-type.patch ia64-move-inline-before-return-type.patch ia64-sn-pci-move-inline-before-type.patch m68k-coldfire-move-inline-before-return-type.patch mips-smp-move-asmlinkage-before-return-type.patch sh-move-inline-before-return-type.patch x86-efi-move-asmlinkage-before-return-type.patch drivers-s390-move-static-and-inline-before-return-type.patch drivers-tty-serial-move-inline-before-return-type.patch usb-serial-safe_serial-move-__inline__-before-return-type.patch video-fbdev-intelfb-move-inline-before-return-type.patch video-fbdev-omap-move-inline-before-return-type.patch arm-samsung-usb-ohci-move-inline-before-return-type.patch