Message ID | 20230614164955.1319870-1-michael.j.ruhl@intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp131151vqr; Wed, 14 Jun 2023 11:00:55 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7IdNQPmb9ebTfMaYJT8ZwbLrjc+BgmtibKHQSMx1lsj3woW8t982PoBKQmhXAGsszcYmJF X-Received: by 2002:a05:6402:114c:b0:50b:fb85:8608 with SMTP id g12-20020a056402114c00b0050bfb858608mr10530438edw.25.1686765655628; Wed, 14 Jun 2023 11:00:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686765655; cv=none; d=google.com; s=arc-20160816; b=EfxSVP8k5pJC3ZDirdh5uTSfAJd6pcSB9AOz+3dliJHY+idy9pW0NoNK5uTO2kRSPE YL2x3s7cli5C0Fqqt3h3aPFIE7I6fAwc5v1jCwTyzrqj+gt+EbUUZOXVzVpZZBRBh7cf unvLN9Mt9Xupn6AHm7MzOMyQvzt3elx9XRkJ06c5JmGnzSAtMkzxpTJfXGN8zyoLUpGD DpBinCKV08q4OblWGFfIahJwd5rou2ZH9v4zy5sBhH94JmszazBnm7J+Wdwr5g78lH19 pPQrv2HJLgp+NQfJ6zRJ+chnAwOG8YsMJo3S9SKy7vtrL5JtA03pQYxE/FCfS2cfmBVq n3dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=UxcM7NpXr6t+M2BdppbpQN6Hj0VbzPddIcGvGsz0FiM=; b=ATvPTx+vlU7LnNLsFQYOEdG9iT10VQyYKIhBKFj/JWS0HV5hmvUnzopHddO5rZKR1M 6Ug83d1XbBQ9G9RdGW8FJ5f8Lvo0Qex2nro1FNaxCKoL/cjtpUAWDToAEP1h4VvFZmTv JKGbBer4kFY3REdqCEAV5sLnephXY86G2pmDv91uaIuJadPs8w1vrQEJj9TCAYv12qaq iHHI+l6LcnXysfMusNEhAQlKxlcT+jZsUqITsNRsHmSGECtSolK8BhpOiCAsjs9NdjmA eoMWmRUNrZnoeoCwdsnQvNh7gGkFMqV5Rrt414ofFYUspLrCnQ7ShkGLfgPKYJt7D4Es YaXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=U5dC4OAO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s13-20020aa7c54d000000b005149904c8f3si5351182edr.411.2023.06.14.11.00.28; Wed, 14 Jun 2023 11:00:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=U5dC4OAO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236260AbjFNQuM (ORCPT <rfc822;n2h9z4@gmail.com> + 99 others); Wed, 14 Jun 2023 12:50:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236096AbjFNQuJ (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 14 Jun 2023 12:50:09 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22DA91FC2 for <linux-kernel@vger.kernel.org>; Wed, 14 Jun 2023 09:50:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686761408; x=1718297408; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=lF5f5n/e4aXoP+GMV3/7WyCPHfb2ROWwQeBKvgiW28A=; b=U5dC4OAOTeM39IdmVazv3LeGrjjN4r78euxwNqjmMhvN7SBZHL28ANYG ACBGLFfwJANEVyBLGA0L8+MAmHCrOUtNQChKjFrVxEy2PaI7DN5sXnKU2 5Z0CkrkjVylMutm2exG5glRilZW4rfy8ZwawBx/sXkKcGHyzmeV+r+Gmy HRzkMJBgkVr4rpLD7dgg9zY4xG2lwpf73kjs5lpb6RZxSh/aw2fJwWbmU Qwx0OPlHVuCiyunwFWsVvqm+segDB+ZIVv47VShi6oJrxOWHnLGUwZlBM 4u0r2sbXn1yKNUovtR+6H+FxTLL4QhMPWWYlLNE8Eeb63JbskXSZGi9bZ Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10741"; a="338304238" X-IronPort-AV: E=Sophos;i="6.00,243,1681196400"; d="scan'208";a="338304238" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jun 2023 09:50:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10741"; a="782162198" X-IronPort-AV: E=Sophos;i="6.00,243,1681196400"; d="scan'208";a="782162198" Received: from awvttdev-05.aw.intel.com ([10.228.212.156]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jun 2023 09:50:04 -0700 From: "Michael J. Ruhl" <michael.j.ruhl@intel.com> To: linux-kernel@vger.kernel.org, apw@canonical.com, joe@perches.com, dwaipayanray1@gmail.com, lukas.bulwahn@gmail.com, corbet@lwn.net, david@redhat.com Cc: "Michael J. Ruhl" <michael.j.ruhl@intel.com> Subject: [PATCH] checkpatch: Include GEM_BUG_xxx variant in the excluded check list Date: Wed, 14 Jun 2023 12:49:55 -0400 Message-Id: <20230614164955.1319870-1-michael.j.ruhl@intel.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768701983549329255?= X-GMAIL-MSGID: =?utf-8?q?1768701983549329255?= |
Series |
checkpatch: Include GEM_BUG_xxx variant in the excluded check list
|
|
Commit Message
Michael J. Ruhl
June 14, 2023, 4:49 p.m. UTC
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(-)
Comments
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",
>-----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",
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.
>-----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
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",