Skip to contentSkip to conversation

checkpatch: fix a false check against wchar/utf-16 string

PATCH New AKASHI Takahiro 4 participants 6 messages Jun 16, 2020 – Jul 3, 2020 Checkpatch

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 checkpatch: fix a false check against wchar/utf-16 string

UEFI subsystem uses utf-16 string, but checkpatch.pl complains about any occurrences of L"xxx" which is definitely legal. So just suppress this kind of warning. Precautiously, we will check u"xxx" as well.

---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/checkpatch.pl +1 -1
index edba36565167..b3697720787c 100755
@@ -5462,7 +5462,7 @@ sub process {
 		}
 
 # concatenated string without spaces between elements
-		if ($line =~ /$String[A-Za-z0-9_]/ || $line =~ /[A-Za-z0-9_]$String/) {
+		if ($line =~ /$String[A-Za-z0-9_]/ || $line =~ /([A-Za-z0-9_]+[Lu]|[A-Za-z0-9_]*[A-KM-Za-tv-z0-9_])$String/) {
 			if (CHK("CONCATENATED_STRING",
 				"Concatenated strings should use spaces between elements\n" . $herecurr) &&
 			    $fix) {
Signature · 1 line
2.27.0
#1 lore raw

PATCH 1/1 checkpatch: fix a false check against wchar/utf-16 string

Quoted 15 lines · AKASHI Takahiro

UEFI subsystem uses utf-16 string, but checkpatch.pl complains about any occurrences of L"xxx" which is definitely legal. So just suppress this kind of warning. Precautiously, we will check u"xxx" as well.

---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/checkpatch.pl +0 -0
index edba36565167..b3697720787c 100755

scripts/checkpatch.pl sub process { · line 5468

Quoted 8 lines
scripts/checkpatch.pl +1 -1
@@ -5462,7 +5462,7 @@ sub process {
 		}
 
 # concatenated string without spaces between elements
-		if ($line =~ /$String[A-Za-z0-9_]/ || $line =~ /[A-Za-z0-9_]$String/) {
+		if ($line =~ /$String[A-Za-z0-9_]/ || $line =~ /([A-Za-z0-9_]+[Lu]|[A-Za-z0-9_]*[A-KM-Za-tv-z0-9_])$String/) {
 			if (CHK("CONCATENATED_STRING",
 				"Concatenated strings should use spaces between elements\n" . $herecurr) &&
 			    $fix) {

This looks like a generic checkpatch issue. I think we're a little out of sync with the kernel's v5.7 but this doesn't look to be fixed there either. Can you please submit it upstream? Thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200616/ab334128/attachment.sig>
#2 lore raw

PATCH 1/1 checkpatch: fix a false check against wchar/utf-16 string

Quoted 19 lines · Tom Rini
Quoted 17 lines · AKASHI Takahiro

UEFI subsystem uses utf-16 string, but checkpatch.pl complains about any occurrences of L"xxx" which is definitely legal. So just suppress this kind of warning. Precautiously, we will check u"xxx" as well.

---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/checkpatch.pl +0 -0
index edba36565167..b3697720787c 100755
@@ -5462,7 +5462,7 @@ sub process {
 		}
 
Quoted 11 lines

scripts/checkpatch.pl sub process { · line 5468

Quoted 6 lines
scripts/checkpatch.pl +1 -1
 # concatenated string without spaces between elements
-		if ($line =~ /$String[A-Za-z0-9_]/ || $line =~ /[A-Za-z0-9_]$String/) {
+		if ($line =~ /$String[A-Za-z0-9_]/ || $line =~ /([A-Za-z0-9_]+[Lu]|[A-Za-z0-9_]*[A-KM-Za-tv-z0-9_])$String/) {
 			if (CHK("CONCATENATED_STRING",
 				"Concatenated strings should use spaces between elements\n" . $herecurr) &&
 			    $fix) {

This looks like a generic checkpatch issue. I think we're a little out of sync with the kernel's v5.7 but this doesn't look to be fixed there either. Can you please submit it upstream? Thanks!

Hello Tom,

I already raised that issue to the Kernel people and they were not interested in fixing it:

https://lkml.org/lkml/2017/10/17/1086

Recently a lot of changes have been done to the U-Boot version of checkpatch.pl.

Do we want to diverge from the upstream and have a lot of work each time we try to sync? Or should we use checkpatch.pl as is and live without U-Boot specific stuff?

Best regards

Heinrich

#3 lore raw

PATCH 1/1 checkpatch: fix a false check against wchar/utf-16 string

Quoted 37 lines · Heinrich Schuchardt
Quoted 19 lines · Tom Rini
Quoted 17 lines · AKASHI Takahiro

UEFI subsystem uses utf-16 string, but checkpatch.pl complains about any occurrences of L"xxx" which is definitely legal. So just suppress this kind of warning. Precautiously, we will check u"xxx" as well.

---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/checkpatch.pl +0 -0
index edba36565167..b3697720787c 100755
@@ -5462,7 +5462,7 @@ sub process {
 		}
 
Quoted 11 lines

scripts/checkpatch.pl sub process { · line 5468

Quoted 6 lines
scripts/checkpatch.pl +1 -1
 # concatenated string without spaces between elements
-		if ($line =~ /$String[A-Za-z0-9_]/ || $line =~ /[A-Za-z0-9_]$String/) {
+		if ($line =~ /$String[A-Za-z0-9_]/ || $line =~ /([A-Za-z0-9_]+[Lu]|[A-Za-z0-9_]*[A-KM-Za-tv-z0-9_])$String/) {
 			if (CHK("CONCATENATED_STRING",
 				"Concatenated strings should use spaces between elements\n" . $herecurr) &&
 			    $fix) {

This looks like a generic checkpatch issue. I think we're a little out of sync with the kernel's v5.7 but this doesn't look to be fixed there either. Can you please submit it upstream? Thanks!

Hello Tom,

I already raised that issue to the Kernel people and they were not interested in fixing it:

Quoted 8 lines

https://lkml.org/lkml/2017/10/17/1086

Recently a lot of changes have been done to the U-Boot version of checkpatch.pl.

Do we want to diverge from the upstream and have a lot of work each time we try to sync? Or should we use checkpatch.pl as is and live without U-Boot specific stuff?

I would raise the issue with Joe again to see if he still doesn't want to support wide strings. If he doesn't I worry that since this change is outside of the new u-boot function it will get removed by accident with a future resync.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200702/17fd69c3/attachment.sig>
#4 lore raw

PATCH 1/1 checkpatch: fix a false check against wchar/utf-16 string

Quoted 43 lines · Tom Rini
Quoted 42 lines · Heinrich Schuchardt
Quoted 19 lines · Tom Rini
Quoted 17 lines · AKASHI Takahiro

UEFI subsystem uses utf-16 string, but checkpatch.pl complains about any occurrences of L"xxx" which is definitely legal. So just suppress this kind of warning. Precautiously, we will check u"xxx" as well.

---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/checkpatch.pl +0 -0
index edba36565167..b3697720787c 100755
@@ -5462,7 +5462,7 @@ sub process {
 		}
 
Quoted 11 lines

scripts/checkpatch.pl sub process { · line 5468

Quoted 6 lines
scripts/checkpatch.pl +1 -1
 # concatenated string without spaces between elements
-		if ($line =~ /$String[A-Za-z0-9_]/ || $line =~ /[A-Za-z0-9_]$String/) {
+		if ($line =~ /$String[A-Za-z0-9_]/ || $line =~ /([A-Za-z0-9_]+[Lu]|[A-Za-z0-9_]*[A-KM-Za-tv-z0-9_])$String/) {
 			if (CHK("CONCATENATED_STRING",
 				"Concatenated strings should use spaces between elements\n" . $herecurr) &&
 			    $fix) {

This looks like a generic checkpatch issue. I think we're a little out of sync with the kernel's v5.7 but this doesn't look to be fixed there either. Can you please submit it upstream? Thanks!

Hello Tom,

I already raised that issue to the Kernel people and they were not interested in fixing it:

https://lkml.org/lkml/2017/10/17/1086

Recently a lot of changes have been done to the U-Boot version of checkpatch.pl.

Quoted 8 lines
Quoted 3 lines

Do we want to diverge from the upstream and have a lot of work each time we try to sync? Or should we use checkpatch.pl as is and live without U-Boot specific stuff?

I would raise the issue with Joe again to see if he still doesn't want to support wide strings. If he doesn't I worry that since this change is outside of the new u-boot function it will get removed by accident with a future resync.

To be strict, Joe's comment, "Kernel doesn't support wide strings." is no longer true. We can see several examples of L"..." in
security/integrity/platform_certs/load_uefi.c

-Takahiro Akashi

Quoted 2 lines
Signature · 1 line
Tom
#5 lore raw

PATCH 1/1 checkpatch: fix a false check against wchar/utf-16 string

Am 3. Juli 2020 07:45:03 MESZ schrieb AKASHI Takahiro <[email protected]>:

Quoted 57 lines · Tom Rini
Quoted 21 lines · Heinrich Schuchardt
Quoted 20 lines · Tom Rini
Quoted 19 lines · AKASHI Takahiro
Quoted 18 lines

UEFI subsystem uses utf-16 string, but checkpatch.pl complains about any occurrences of L"xxx" which is definitely legal. So just suppress this kind of warning. Precautiously, we will check u"xxx" as well.

---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/checkpatch.pl +0 -0
index edba36565167..b3697720787c 100755
@@ -5462,7 +5462,7 @@ sub process {
 		}
 
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

scripts/checkpatch.pl sub process { · line 5465

Quoted 2 lines
scripts/checkpatch.pl +0 -1
 # concatenated string without spaces between elements
-		if ($line =~ /$String[A-Za-z0-9_]/ || $line =~

/[A-Za-z0-9_]$String/) {

Quoted 1 line
Quoted 1 line
Quoted 1 line

scripts/checkpatch.pl sub process { · line 5465

Quoted 1 line
scripts/checkpatch.pl +1 -0
+		if ($line =~ /$String[A-Za-z0-9_]/ || $line =~

/([A-Za-z0-9_]+[Lu]|[A-Za-z0-9_]*[A-KM-Za-tv-z0-9_])$String/) {

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

scripts/checkpatch.pl sub process { · line 5467

Quoted 2 lines
scripts/checkpatch.pl +0 -0
 			if (CHK("CONCATENATED_STRING",
 				"Concatenated strings should use spaces between elements\n"

. $herecurr) &&

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

scripts/checkpatch.pl sub process { · line 5468

Quoted 1 line
scripts/checkpatch.pl +0 -0
 			    $fix) {

This looks like a generic checkpatch issue. I think we're a

little out

Quoted 1 line
Quoted 1 line
Quoted 1 line

of sync with the kernel's v5.7 but this doesn't look to be fixed

there

Quoted 8 lines
Quoted 8 lines
Quoted 2 lines

either. Can you please submit it upstream? Thanks!

Hello Tom,

I already raised that issue to the Kernel people and they were not interested in fixing it:

Quoted 6 lines
Quoted 6 lines

https://lkml.org/lkml/2017/10/17/1086

Recently a lot of changes have been done to the U-Boot version of checkpatch.pl.

Do we want to diverge from the upstream and have a lot of work each

time

Quoted 1 line
Quoted 1 line

we try to sync? Or should we use checkpatch.pl as is and live

without

Quoted 3 lines
Quoted 1 line

U-Boot specific stuff?

I would raise the issue with Joe again to see if he still doesn't

want

Quoted 8 lines
Quoted 1 line

to support wide strings. If he doesn't I worry that since this

change

Quoted 2 lines

is outside of the new u-boot function it will get removed by accident with a future resync.

To be strict, Joe's comment, "Kernel doesn't support wide strings." is no longer true. We can see several examples of L"..." in
security/integrity/platform_certs/load_uefi.c

That makes things easier. Please, check if the upstream checkpatch.pl still has the issue. If yes, please, send your pstch upstream.

Best regards

Heinrich

Quoted 5 lines

-Takahiro Akashi

Quoted 2 lines
Signature · 1 line
Tom