diff mbox series

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

Message ID 20200616054307.6017-1-takahiro.akashi@linaro.org
State New
Headers show
Series checkpatch: fix a false check against wchar/utf-16 string | expand

Commit Message

AKASHI Takahiro June 16, 2020, 5:43 a.m. UTC
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.

Signed-off-by: AKASHI Takahiro <takahiro.akashi at linaro.org>
---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Tom Rini June 16, 2020, 2:17 p.m. UTC | #1
On Tue, Jun 16, 2020 at 02:43:07PM +0900, AKASHI Takahiro wrote:

> 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.
> 
> Signed-off-by: AKASHI Takahiro <takahiro.akashi at linaro.org>
> ---
>  scripts/checkpatch.pl | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index edba36565167..b3697720787c 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -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!
diff mbox series

Patch

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index edba36565167..b3697720787c 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -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) {