Skip to contentSkip to conversation

checkpatch-improve-missing-blank-line-after-declarations-test.patch removed from -mm tree

folded-merged [email protected] 1 participant 1 message Jun 4, 2014 Checkpatch

lore
Share & tools
lore
#0 lore raw

Subject: [folded-merged] checkpatch-improve-missing-blank-line-after-declarations-test.patch removed from -mm tree
To: [email protected],[email protected]
From: [email protected]
Date: Wed, 04 Jun 2014 15:54:12 -0700

The patch titled
Subject: checkpatch: improve missing blank line after declarations test
has been removed from the -mm tree. Its filename was
checkpatch-improve-missing-blank-line-after-declarations-test.patch

This patch was dropped because it was folded into checkpatch-always-warn-on-missing-blank-line-after-variable-declaration-block.patch

------------------------------------------------------
From: Joe Perches <[email protected]>
Subject: checkpatch: improve missing blank line after declarations test

A couple more modifications to the declarations tests.

o Declarations can also be bitfields so exclude things with a colon
o Make sure the current and previous lines are indented the same to avoid matching some macro where a struct type is passed on the previous line like:

		next = list_entry(buffer->entry.next,
				  struct binder_buffer, entry);
		if (buffer_start_page(next) == buffer_end_page(buffer))

---

 scripts/checkpatch.pl |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
scripts/checkpatch.pl renamed from scripts/checkpatch.pl~checkpatch-improve-missing-blank-line-after-declarations-test +5 -3
diff -puN scripts/checkpatch.pl~checkpatch-improve-missing-blank-line-after-declarations-test scripts/checkpatch.pl
@@ -2275,7 +2275,7 @@ sub process {
 # check for missing blank lines after declarations
 		if ($sline =~ /^\+\s+\S/ &&			#Not at char 1
 			# actual declarations
-		    ($prevline =~ /^\+\s+$Declare\s*$Ident\s*[=,;\[]/ ||
+		    ($prevline =~ /^\+\s+$Declare\s*$Ident\s*[=,;:\[]/ ||
 			# foo bar; where foo is some local typedef or #define
 		     $prevline =~ /^\+\s+$Ident(?:\s+|\s*\*\s*)$Ident\s*[=,;\[]/ ||
 			# known declaration macros
@@ -2287,7 +2287,7 @@ sub process {
 			# not starting a section or a macro "\" extended line
 		      $prevline =~ /(?:\{\s*|\\)$/) &&
 			# looks like a declaration
-		    !($sline =~ /^\+\s+$Declare\s*$Ident\s*[=,;\[]/ ||
+		    !($sline =~ /^\+\s+$Declare\s*$Ident\s*[=,;:\[]/ ||
 			# foo bar; where foo is some local typedef or #define
 		      $sline =~ /^\+\s+$Ident(?:\s+|\s*\*\s*)$Ident\s*[=,;\[]/ ||
 			# known declaration macros
@@ -2299,7 +2299,9 @@ sub process {
 			# bitfield continuation
 		      $sline =~ /^\+\s+$Ident\s*:\s*\d+\s*[,;]/ ||
 			# other possible extensions of declaration lines
-		      $sline =~ /^\+\s+\(?\s*(?:$Compare|$Assignment|$Operators)/)) {
+		      $sline =~ /^\+\s+\(?\s*(?:$Compare|$Assignment|$Operators)/) &&
+			# indentation of previous and current line are the same
+		    (($prevline =~ /\+(\s+)\S/) && $sline =~ /^\+$1\S/)) {
 			WARN("SPACING",
 			     "Missing a blank line after declarations\n" . $hereprev);
 		}

_

Patches currently in -mm which might be from [email protected] are

origin.patch maintainers-add-me-as-the-get_maintainerpl-maintainer.patch mm-slubc-convert-printk-to-pr_foo.patch mm-slubc-convert-vnsprintf-static-to-va_format.patch documentation-expand-clarify-debug-documentation.patch printk-use-symbolic-defines-for-console-loglevels.patch lib-bugc-convert-printk-to-pr_foo.patch checkpatch-fix-wildcard-dt-compatible-string-checking.patch checkpatch-always-warn-on-missing-blank-line-after-variable-declaration-block.patch checkpatch-make-strict-a-default-for-files-in-drivers-net-and-net.patch checkpatch-warn-on-defines-ending-in-semicolon.patch checkpatch-add-warning-for-kmalloc-kzalloc-with-multiply.patch checkpatch-prefer-kstrtofoo-to-sscanfbuf-%lhuidx-bar.patch checkpatch-warn-on-unnecessary-void-function-return-statements.patch checkpatch-check-stable-email-address.patch scripts-checkpatchpl-device_initcall-is-not-the-only-__initcall-substitute.patch fs-efs-convert-printk-to-pr_foo.patch fs-efs-add-pr_fmt-use-__func__.patch fs-efs-convert-printkkern_debug-to-pr_debug.patch init-mainc-dont-use-pr_debug.patch