From 5b906129524d564d61760d04586d6c2301457ead Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Mon, 5 Oct 2015 14:45:55 +0200 Subject: checkpatch: allow open braces on typedef lines The style here seems to be split according to the maintainer, but traditionally open braces were placed on typedef lines. Suggested-by: Peter Maydell Signed-off-by: Paolo Bonzini --- scripts/checkpatch.pl | 5 ----- 1 file changed, 5 deletions(-) (limited to 'scripts') diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index b6d71ea..d51346a 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -1704,11 +1704,6 @@ sub process { ERROR("open brace '{' following $1 go on the same line\n" . $hereprev); } -# ... however, open braces on typedef lines should be avoided. - if ($line =~ /^.\s*typedef\s+(enum|union|struct)(?:\s+$Ident\b)?.*[^;]$/) { - ERROR("typedefs should be separate from struct declaration\n" . $herecurr); - } - # missing space after union, struct or enum definition if ($line =~ /^.\s*(?:typedef\s+)?(enum|union|struct)(?:\s+$Ident)?(?:\s+$Ident)?[=\{]/) { ERROR("missing space after $1 definition\n" . $herecurr); -- cgit v1.1 From 3e5385fcf536fc4238eb87de55af8dd99089cad4 Mon Sep 17 00:00:00 2001 From: Andy Whitcroft Date: Thu, 8 Oct 2015 10:05:24 +0200 Subject: checkpatch: port fix from kernel "## is not a valid modifier" checkpatch currently loops on fpu/softfloat.c Turns out this is fixed in the Linux version of checkpatch. So this is a port of Andy Whitcrofts fix from Linux, Original commit was commit 89a883530fe7 ("checkpatch: ## is not a valid modifier") As suggested by Peter Maydell for the QEMU version we drop the last "|" as there seems to be no need for that. (FWIW, the kernel discusion about that dried out: http://www.spinics.net/lists/kernel/msg1944421.html ) Cc: Andy Whitcroft Signed-off-by: Christian Borntraeger Message-Id: <1444291524-66569-1-git-send-email-borntraeger@de.ibm.com> Signed-off-by: Paolo Bonzini --- scripts/checkpatch.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index d51346a..b0f6e11 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -1010,7 +1010,9 @@ sub possible { case| else| asm|__asm__| - do + do| + \#| + \#\# )(?:\s|$)| ^(?:typedef|struct|enum)\b )}x; -- cgit v1.1