Skip to contentSkip to conversation

checkpatch: Include GEM_BUG_xxx variant in the excluded check list

PATCH In review Michael J. Ruhl 3 participants 5 messages Jun 14, 2023 – Jun 15, 2023 Checkpatch

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 checkpatch: Include GEM_BUG_xxx variant in the excluded check list

GEM_BUG_ON is usually compiled as WARN. You have to change to debug configuration to get this to be BUG.

checkpatch flags this a WARN level issue.

Since this is a i915 local debug macro, allow its use in checkpatch.pl.

Fixes 69d517e6e210 ("checkpatch: warn on usage of VM_BUG_ON() and other BUG variants")
---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/checkpatch.pl +1 -1
index b30114d637c4..d3ddde4cd63e 100755
@@ -4821,7 +4821,7 @@ sub process {
 		}
 
 # do not use BUG() or variants
-		if ($line =~ /\b(?!AA_|BUILD_|DCCP_|IDA_|KVM_|RWLOCK_|snd_|SPIN_)(?:[a-zA-Z_]*_)?BUG(?:_ON)?(?:_[A-Z_]+)?\s*\(/) {
+		if ($line =~ /\b(?!AA_|BUILD_|DCCP_|GEM_|IDA_|KVM_|RWLOCK_|snd_|SPIN_)(?:[a-zA-Z_]*_)?BUG(?:_ON)?(?:_[A-Z_]+)?\s*\(/) {
 			my $msg_level = \&WARN;
 			$msg_level = \&CHK if ($file);
 			&{$msg_level}("AVOID_BUG",
Signature · 1 line
2.39.2
maintainer
#1 lore raw
Quoted 8 lines · Michael J. Ruhl

GEM_BUG_ON is usually compiled as WARN. You have to change to debug configuration to get this to be BUG.

checkpatch flags this a WARN level issue.

Since this is a i915 local debug macro, allow its use in checkpatch.pl.

Fixes 69d517e6e210 ("checkpatch: warn on usage of VM_BUG_ON() and other BUG variants")

Not a "Fixes", just an additional check

Quoted 19 lines
---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/checkpatch.pl +1 -1
index b30114d637c4..d3ddde4cd63e 100755
@@ -4821,7 +4821,7 @@ sub process {
 		}
 
 # do not use BUG() or variants
-		if ($line =~ /\b(?!AA_|BUILD_|DCCP_|IDA_|KVM_|RWLOCK_|snd_|SPIN_)(?:[a-zA-Z_]*_)?BUG(?:_ON)?(?:_[A-Z_]+)?\s*\(/) {
+		if ($line =~ /\b(?!AA_|BUILD_|DCCP_|GEM_|IDA_|KVM_|RWLOCK_|snd_|SPIN_)(?:[a-zA-Z_]*_)?BUG(?:_ON)?(?:_[A-Z_]+)?\s*\(/) {
 			my $msg_level = \&WARN;
 			$msg_level = \&CHK if ($file);
 			&{$msg_level}("AVOID_BUG",
#2 lore raw
Quoted 13 lines

-----Original Message-----
From: Joe Perches <[email protected]>
Sent: Wednesday, June 14, 2023 9:47 PM
To: Ruhl, Michael J <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH] checkpatch: Include GEM_BUG_xxx variant in the excluded check list

Quoted 3 lines · Michael J. Ruhl

GEM_BUG_ON is usually compiled as WARN. You have to change to debug configuration to get this to be BUG.

Quoted 8 lines
Quoted 5 lines

checkpatch flags this a WARN level issue.

Since this is a i915 local debug macro, allow its use in checkpatch.pl.

Fixes 69d517e6e210 ("checkpatch: warn on usage of VM_BUG_ON() and

other BUG variants")

Not a "Fixes", just an additional check

That makes sense.

Do I need to resubmit without the Fixes?

Thanks,

M

Quoted 23 lines
Quoted 11 lines
---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/checkpatch.pl +0 -0
index b30114d637c4..d3ddde4cd63e 100755

scripts/checkpatch.pl sub process { · line 4824

Quoted 4 lines
scripts/checkpatch.pl +0 -1
@@ -4821,7 +4821,7 @@ sub process {
 		}
 
 # do not use BUG() or variants
-		if ($line =~

/\b(?!AA_|BUILD_|DCCP_|IDA_|KVM_|RWLOCK_|snd_|SPIN_)(?:[a-zA- Z_]*_)?BUG(?:_ON)?(?:_[A-Z_]+)?\s*\(/) {

scripts/checkpatch.pl sub process { · line 4824

Quoted 1 line
scripts/checkpatch.pl +1 -0
+		if ($line =~

/\b(?!AA_|BUILD_|DCCP_|GEM_|IDA_|KVM_|RWLOCK_|snd_|SPIN_)(?:[a -zA-Z_]*_)?BUG(?:_ON)?(?:_[A-Z_]+)?\s*\(/) {

Quoted 3 lines
scripts/checkpatch.pl +0 -0
 			my $msg_level = \&WARN;
 			$msg_level = \&CHK if ($file);
 			&{$msg_level}("AVOID_BUG",
#3 lore raw
Quoted 13 lines · Michael J
Quoted 13 lines

-----Original Message-----
From: Joe Perches <[email protected]>
Sent: Wednesday, June 14, 2023 9:47 PM
To: Ruhl, Michael J <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH] checkpatch: Include GEM_BUG_xxx variant in the excluded check list

Quoted 3 lines · Michael J. Ruhl

GEM_BUG_ON is usually compiled as WARN. You have to change to debug configuration to get this to be BUG.

Quoted 9 lines
Quoted 8 lines
Quoted 5 lines

checkpatch flags this a WARN level issue.

Since this is a i915 local debug macro, allow its use in checkpatch.pl.

Fixes 69d517e6e210 ("checkpatch: warn on usage of VM_BUG_ON() and

other BUG variants")

Not a "Fixes", just an additional check

That was discussed when developing that patch:

https://lore.kernel.org/linux-mm/[email protected]/T/

GEM_BUG_ON(
-> Bad with CONFIG_DRM_I915_DEBUG_GEM_ONCE

Just like VM_BUG_ON or CI_BUG_ON... that BUGs only with another kernel config on.

So this is expected.

Signature · 3 lines
Cheers,

David / dhildenb
#4 lore raw
Quoted 39 lines

-----Original Message-----
From: David Hildenbrand <[email protected]>
Sent: Thursday, June 15, 2023 11:28 AM
To: Ruhl, Michael J <[email protected]>; Joe Perches <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH] checkpatch: Include GEM_BUG_xxx variant in the excluded check list

Quoted 4 lines · Michael J
Quoted 4 lines

-----Original Message-----
From: Joe Perches <[email protected]>
Sent: Wednesday, June 14, 2023 9:47 PM
To: Ruhl, Michael J <[email protected]>; linux-

[email protected];

Quoted 1 line
Quoted 1 line

[email protected]; [email protected];

[email protected];

Quoted 8 lines
Quoted 8 lines

[email protected]; [email protected]
Subject: Re: [PATCH] checkpatch: Include GEM_BUG_xxx variant in the excluded check list

Quoted 3 lines · Michael J. Ruhl

GEM_BUG_ON is usually compiled as WARN. You have to change to debug configuration to get this to be BUG.

Quoted 9 lines
Quoted 8 lines
Quoted 5 lines

checkpatch flags this a WARN level issue.

Since this is a i915 local debug macro, allow its use in checkpatch.pl.

Fixes 69d517e6e210 ("checkpatch: warn on usage of VM_BUG_ON() and

other BUG variants")

Not a "Fixes", just an additional check

That was discussed when developing that patch:

https://lore.kernel.org/linux-mm/[email protected]/T/

Quoted 7 lines

GEM_BUG_ON(
-> Bad with CONFIG_DRM_I915_DEBUG_GEM_ONCE

Just like VM_BUG_ON or CI_BUG_ON... that BUGs only with another kernel config on.

So this is expected.

Hmm,

Ok.

Maybe next time.

M

Quoted 4 lines

--
Cheers,

David / dhildenb