linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] checkpatch: Include GEM_BUG_xxx variant in the excluded check list
@ 2023-06-14 16:49 Michael J. Ruhl
  2023-06-15  1:47 ` Joe Perches
  0 siblings, 1 reply; 5+ messages in thread
From: Michael J. Ruhl @ 2023-06-14 16:49 UTC (permalink / raw)
  To: linux-kernel, apw, joe, dwaipayanray1, lukas.bulwahn, corbet, david
  Cc: 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")

Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index b30114d637c4..d3ddde4cd63e 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -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.39.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] checkpatch: Include GEM_BUG_xxx variant in the excluded check list
  2023-06-14 16:49 [PATCH] checkpatch: Include GEM_BUG_xxx variant in the excluded check list Michael J. Ruhl
@ 2023-06-15  1:47 ` Joe Perches
  2023-06-15 15:04   ` Ruhl, Michael J
  0 siblings, 1 reply; 5+ messages in thread
From: Joe Perches @ 2023-06-15  1:47 UTC (permalink / raw)
  To: Michael J. Ruhl, linux-kernel, apw, dwaipayanray1, lukas.bulwahn,
	corbet, david

On Wed, 2023-06-14 at 12:49 -0400, Michael J. Ruhl wrote:
> 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

> 
> Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
> ---
>  scripts/checkpatch.pl | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index b30114d637c4..d3ddde4cd63e 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -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",


^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH] checkpatch: Include GEM_BUG_xxx variant in the excluded check list
  2023-06-15  1:47 ` Joe Perches
@ 2023-06-15 15:04   ` Ruhl, Michael J
  2023-06-15 15:28     ` David Hildenbrand
  0 siblings, 1 reply; 5+ messages in thread
From: Ruhl, Michael J @ 2023-06-15 15:04 UTC (permalink / raw)
  To: Joe Perches, linux-kernel, apw, dwaipayanray1, lukas.bulwahn,
	corbet, david

>-----Original Message-----
>From: Joe Perches <joe@perches.com>
>Sent: Wednesday, June 14, 2023 9:47 PM
>To: Ruhl, Michael J <michael.j.ruhl@intel.com>; linux-kernel@vger.kernel.org;
>apw@canonical.com; dwaipayanray1@gmail.com; lukas.bulwahn@gmail.com;
>corbet@lwn.net; david@redhat.com
>Subject: Re: [PATCH] checkpatch: Include GEM_BUG_xxx variant in the
>excluded check list
>
>On Wed, 2023-06-14 at 12:49 -0400, Michael J. Ruhl wrote:
>> 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

That makes sense.

Do I need to resubmit without the Fixes?

Thanks,

M

>>
>> Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
>> ---
>>  scripts/checkpatch.pl | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
>> index b30114d637c4..d3ddde4cd63e 100755
>> --- a/scripts/checkpatch.pl
>> +++ b/scripts/checkpatch.pl
>> @@ -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",


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] checkpatch: Include GEM_BUG_xxx variant in the excluded check list
  2023-06-15 15:04   ` Ruhl, Michael J
@ 2023-06-15 15:28     ` David Hildenbrand
  2023-06-15 19:23       ` Ruhl, Michael J
  0 siblings, 1 reply; 5+ messages in thread
From: David Hildenbrand @ 2023-06-15 15:28 UTC (permalink / raw)
  To: Ruhl, Michael J, Joe Perches, linux-kernel, apw, dwaipayanray1,
	lukas.bulwahn, corbet

On 15.06.23 17:04, Ruhl, Michael J wrote:
>> -----Original Message-----
>> From: Joe Perches <joe@perches.com>
>> Sent: Wednesday, June 14, 2023 9:47 PM
>> To: Ruhl, Michael J <michael.j.ruhl@intel.com>; linux-kernel@vger.kernel.org;
>> apw@canonical.com; dwaipayanray1@gmail.com; lukas.bulwahn@gmail.com;
>> corbet@lwn.net; david@redhat.com
>> Subject: Re: [PATCH] checkpatch: Include GEM_BUG_xxx variant in the
>> excluded check list
>>
>> On Wed, 2023-06-14 at 12:49 -0400, Michael J. Ruhl wrote:
>>> 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
> 

That was discussed when developing that patch:

https://lore.kernel.org/linux-mm/87tu5vflld.fsf@intel.com/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.

-- 
Cheers,

David / dhildenb


^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH] checkpatch: Include GEM_BUG_xxx variant in the excluded check list
  2023-06-15 15:28     ` David Hildenbrand
@ 2023-06-15 19:23       ` Ruhl, Michael J
  0 siblings, 0 replies; 5+ messages in thread
From: Ruhl, Michael J @ 2023-06-15 19:23 UTC (permalink / raw)
  To: David Hildenbrand, Joe Perches, linux-kernel, apw, dwaipayanray1,
	lukas.bulwahn, corbet

>-----Original Message-----
>From: David Hildenbrand <david@redhat.com>
>Sent: Thursday, June 15, 2023 11:28 AM
>To: Ruhl, Michael J <michael.j.ruhl@intel.com>; Joe Perches
><joe@perches.com>; linux-kernel@vger.kernel.org; apw@canonical.com;
>dwaipayanray1@gmail.com; lukas.bulwahn@gmail.com; corbet@lwn.net
>Subject: Re: [PATCH] checkpatch: Include GEM_BUG_xxx variant in the
>excluded check list
>
>On 15.06.23 17:04, Ruhl, Michael J wrote:
>>> -----Original Message-----
>>> From: Joe Perches <joe@perches.com>
>>> Sent: Wednesday, June 14, 2023 9:47 PM
>>> To: Ruhl, Michael J <michael.j.ruhl@intel.com>; linux-
>kernel@vger.kernel.org;
>>> apw@canonical.com; dwaipayanray1@gmail.com;
>lukas.bulwahn@gmail.com;
>>> corbet@lwn.net; david@redhat.com
>>> Subject: Re: [PATCH] checkpatch: Include GEM_BUG_xxx variant in the
>>> excluded check list
>>>
>>> On Wed, 2023-06-14 at 12:49 -0400, Michael J. Ruhl wrote:
>>>> 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
>>
>
>That was discussed when developing that patch:
>
>https://lore.kernel.org/linux-mm/87tu5vflld.fsf@intel.com/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.

Hmm,

Ok.

Maybe next time.

M

>--
>Cheers,
>
>David / dhildenb


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-06-15 19:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-14 16:49 [PATCH] checkpatch: Include GEM_BUG_xxx variant in the excluded check list Michael J. Ruhl
2023-06-15  1:47 ` Joe Perches
2023-06-15 15:04   ` Ruhl, Michael J
2023-06-15 15:28     ` David Hildenbrand
2023-06-15 19:23       ` Ruhl, Michael J

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).