checkpatch: reversed logic with acpi test checks
PATCH 1/1 checkpatch: reversed logic with acpi test checks
Logic reversed: allowed list should just be ignored. Instead we only take that into account :(
--- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/checkpatch.pl +1 -1
@@ -1267,7 +1267,7 @@ sub checkfilename { # files and when changing tests. if ($name =~ m#^tests/data/acpi/# and not $name =~ m#^\.sh$#) { $$acpi_testexpected = $name; - } elsif ($name =~ m#^tests/qtest/bios-tables-test-allowed-diff.h$#) { + } elsif (not $name =~ m#^tests/qtest/bios-tables-test-allowed-diff.h$#) { $$acpi_nontestexpected = $name; } if (defined $$acpi_testexpected and defined $$acpi_nontestexpected) {
Signature · 1 line
MST
Quoted 15 lines · Michael S. Tsirkin
Logic reversed: allowed list should just be ignored. Instead we only take that into account :(
Fixes e11b06a880ca ("checkpatch: ignore allowed diff list")Signed-off-by Michael S. Tsirkin <[email protected]>--- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)scripts/checkpatch.pl +0
-0
scripts/checkpatch.pl sub checkfilename { · line 1273
Quoted 8 lines
scripts/checkpatch.pl +1
-1@@ -1267,7 +1267,7 @@ sub checkfilename { # files and when changing tests. if ($name =~ m#^tests/data/acpi/# and not $name =~ m#^\.sh$#) { $$acpi_testexpected = $name; - } elsif ($name =~ m#^tests/qtest/bios-tables-test-allowed-diff.h$#) { + } elsif (not $name =~ m#^tests/qtest/bios-tables-test-allowed-diff.h$#) { $$acpi_nontestexpected = $name; } if (defined $$acpi_testexpected and defined $$acpi_nontestexpected) {
Hi,
Quoted 5 lines · Michael S. Tsirkin
Logic reversed: allowed list should just be ignored. Instead we only take that into account :(
Fixes e11b06a880ca ("checkpatch: ignore allowed diff list")Signed-off-by Michael S. Tsirkin <[email protected]>
Fixes issues reported in "[RFC 0/6] TPM-TIS bios-tables-test" cover letter
Thanks
Eric
Quoted 18 lines
--- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)scripts/checkpatch.pl +1
-1@@ -1267,7 +1267,7 @@ sub checkfilename { # files and when changing tests. if ($name =~ m#^tests/data/acpi/# and not $name =~ m#^\.sh$#) { $$acpi_testexpected = $name; - } elsif ($name =~ m#^tests/qtest/bios-tables-test-allowed-diff.h$#) { + } elsif (not $name =~ m#^tests/qtest/bios-tables-test-allowed-diff.h$#) { $$acpi_nontestexpected = $name; } if (defined $$acpi_testexpected and defined $$acpi_nontestexpected) {
Paolo Bonzini
AppliedQuoted 15 lines · Michael S. Tsirkin
Logic reversed: allowed list should just be ignored. Instead we only take that into account :(
Fixes e11b06a880ca ("checkpatch: ignore allowed diff list")Signed-off-by Michael S. Tsirkin <[email protected]>--- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)scripts/checkpatch.pl +0
-0
scripts/checkpatch.pl sub checkfilename { · line 1273
Quoted 8 lines
scripts/checkpatch.pl +1
-1@@ -1267,7 +1267,7 @@ sub checkfilename { # files and when changing tests. if ($name =~ m#^tests/data/acpi/# and not $name =~ m#^\.sh$#) { $$acpi_testexpected = $name; - } elsif ($name =~ m#^tests/qtest/bios-tables-test-allowed-diff.h$#) { + } elsif (not $name =~ m#^tests/qtest/bios-tables-test-allowed-diff.h$#) { $$acpi_nontestexpected = $name; } if (defined $$acpi_testexpected and defined $$acpi_nontestexpected) {
Queued with "!~" to achieve the logical not.
Paolo
Quoted 27 lines · Paolo Bonzini
Quoted 15 lines · Michael S. Tsirkin
Logic reversed: allowed list should just be ignored. Instead we only take that into account :(
Fixes e11b06a880ca ("checkpatch: ignore allowed diff list")Signed-off-by Michael S. Tsirkin <[email protected]>--- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)scripts/checkpatch.pl +0
-0scripts/checkpatch.pl sub checkfilename { · line 1273
Quoted 8 lines
scripts/checkpatch.pl +1
-1@@ -1267,7 +1267,7 @@ sub checkfilename { # files and when changing tests. if ($name =~ m#^tests/data/acpi/# and not $name =~ m#^\.sh$#) { $$acpi_testexpected = $name; - } elsif ($name =~ m#^tests/qtest/bios-tables-test-allowed-diff.h$#) { + } elsif (not $name =~ m#^tests/qtest/bios-tables-test-allowed-diff.h$#) { $$acpi_nontestexpected = $name; } if (defined $$acpi_testexpected and defined $$acpi_nontestexpected) {Queued with "!~" to achieve the logical not.
Quoted 1 line
Paolo
Hmm perl manual says "not" is the logical not. Weird. What's !~? My perl is a bit rusty :)
Quoted 9 lines · Michael S. Tsirkin
Quoted 8 lines · Paolo Bonzini
Quoted 5 lines · Michael S. Tsirkin
+ } elsif (not $name =~ m#^tests/qtest/bios-tables-test-allowed-diff.h$#) { $$acpi_nontestexpected = $name; } if (defined $$acpi_testexpected and defined $$acpi_nontestexpected) {
Quoted 6 lines
Quoted 3 lines
Queued with "!~" to achieve the logical not.
Paolo
Hmm perl manual says "not" is the logical not. Weird. What's !~? My perl is a bit rusty :)
man perlop says:
# Binary "!~" is just like "=~" except the return value is negated in the logical sense.
So it's more idiomatic to use it directly rather than using =~ and then doing a logical negation separately.
thanks
-- PMM