Skip to contentSkip to conversation

checkpatch: port fix from kernel "## is not a valid modifier"

PATCH In review Christian Borntraeger 3 participants 5 messages Feb 9, 2015 – Feb 10, 2015 Checkpatch

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 checkpatch: port fix from kernel "## is not a valid modifier"

From: Andy Whitcroft <[email protected]>

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")

---
 scripts/checkpatch.pl | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
scripts/checkpatch.pl +3 -1
index 5df61f9..8635f4c 100755
@@ -1061,7 +1061,9 @@ sub possible {
 			case|
 			else|
 			asm|__asm__|
-			do
+			do|
+			\#|
+			\#\#|
 		)(?:\s|$)|
 		^(?:typedef|struct|enum)\b
 	    )}x;
Signature · 1 line
1.9.3
#1 lore raw
Quoted 20 lines · Christian Borntraeger

From: Andy Whitcroft <[email protected]>

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")

---
 scripts/checkpatch.pl | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
scripts/checkpatch.pl +0 -0
index 5df61f9..8635f4c 100755

scripts/checkpatch.pl sub possible { · line 1066

Quoted 7 lines
scripts/checkpatch.pl +3 -1
@@ -1061,7 +1061,9 @@ sub possible {
                        case|
                        else|
                        asm|__asm__|
-                       do
+                       do|
+                       \#|
+                       \#\#|

Are you sure this line should end with a '|', given it's the last item in the alternation ?

Quoted 6 lines
scripts/checkpatch.pl +0 -1
                )(?:\s|$)|
                ^(?:typedef|struct|enum)\b
            )}x;
--

1.9.3

thanks
-- PMM

#2 lore raw

Am 09.02.2015 um 23:54 schrieb Peter Maydell:

Quoted 17 lines
Quoted 15 lines · Christian Borntraeger

From: Andy Whitcroft <[email protected]>

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")

---
 scripts/checkpatch.pl | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Quoted 15 lines

scripts/checkpatch.pl sub possible { · line 1066

Quoted 12 lines
scripts/checkpatch.pl +3 -1
index 5df61f9..8635f4c 100755
@@ -1061,7 +1061,9 @@ sub possible {
                        case|
                        else|
                        asm|__asm__|
-                       do
+                       do|
+                       \#|
+                       \#\#|

Are you sure this line should end with a '|', given it's the last item in the alternation ?

Good question - dont know. But the kernel version looks the same.

#3 lore raw
In reply to Peter Maydell

Am 09.02.2015 um 23:54 schrieb Peter Maydell:

Quoted 17 lines
Quoted 15 lines · Christian Borntraeger

From: Andy Whitcroft <[email protected]>

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")

---
 scripts/checkpatch.pl | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Quoted 15 lines

scripts/checkpatch.pl sub possible { · line 1066

Quoted 12 lines
scripts/checkpatch.pl +3 -1
index 5df61f9..8635f4c 100755
@@ -1061,7 +1061,9 @@ sub possible {
                        case|
                        else|
                        asm|__asm__|
-                       do
+                       do|
+                       \#|
+                       \#\#|

Are you sure this line should end with a '|', given it's the last item in the alternation ?

Getting rid of that additional | also works, but both ways fix the endless loop.
Certainly not having the "|" seems cleaner. (No idea why it works).
Shall I respin without the "|"? I will then also send a patch for the kernel, in case we resync again in the future.

Christian

#4 lore raw
Quoted 34 lines · Christian Borntraeger

Am 09.02.2015 um 23:54 schrieb Peter Maydell:

Quoted 17 lines
Quoted 15 lines · Christian Borntraeger

From: Andy Whitcroft <[email protected]>

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")

---
 scripts/checkpatch.pl | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Quoted 15 lines

scripts/checkpatch.pl sub possible { · line 1066

Quoted 12 lines
scripts/checkpatch.pl +3 -1
index 5df61f9..8635f4c 100755
@@ -1061,7 +1061,9 @@ sub possible {
                        case|
                        else|
                        asm|__asm__|
-                       do
+                       do|
+                       \#|
+                       \#\#|

Are you sure this line should end with a '|', given it's the last item in the alternation ?

Quoted 4 lines

Getting rid of that additional | also works, but both ways fix the endless loop. Certainly not having the "|" seems cleaner. (No idea why it works). Shall I respin without the "|"? I will then also send a patch for the kernel, in case we resync again in the future.

If it works, I'd take it as is into QEMU, and get the cleanup from the kernel in the next resync.