Linux CXL
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Guixin Liu <kanie@linux.alibaba.com>
Cc: Andy Whitcroft <apw@canonical.com>, Joe Perches <joe@perches.com>,
	Alison Schofield <alison.schofield@intel.com>,
	linux-kernel@vger.kernel.org, linux-cxl@vger.kernel.org
Subject: Re: [PATCH v2] checkpatch: don't flag ACQUIRE_ERR() assignments in if conditions
Date: Sat, 26 Sep 2026 00:09:47 +0100	[thread overview]
Message-ID: <20260926000933.6d51223e@jic23-hlaptop> (raw)
In-Reply-To: <20260924033923.4140210-1-kanie@linux.alibaba.com>

On Thu, 24 Sep 2026 11:39:23 +0800
Guixin Liu <kanie@linux.alibaba.com> wrote:

> ACQUIRE_ERR() and its wrappers, PM_RUNTIME_ACQUIRE_ERR() and
> IIO_DEV_ACQUIRE_FAILED(), report whether a conditional cleanup.h guard
> was acquired, and drivers consume the result directly in an if
> condition:
> 
> 	if ((rc = ACQUIRE_ERR(mutex_intr, &lock)))
> 		return rc;
> 
> That combined form is the established style at the 49 in-tree call
> sites under drivers/cxl and drivers/pci/tsm.c, so ASSIGN_IN_IF fires
> there only as a false positive, and every patch touching those lines
> carries noise that reviewers have to wave off manually.
> 
> Skip the check only when every assignment in the condition assigns the
> result of such a call, matched by the *_ACQUIRE_ERR() /
> *_ACQUIRE_FAILED() naming convention of its wrappers. Plain
> assignments, mixed conditions and near-miss identifiers still get
> flagged.
> 
> Suggested-by: Alison Schofield <alison.schofield@intel.com>
> Cc: linux-cxl@vger.kernel.org
> Assisted-by: LLM
> Signed-off-by: Guixin Liu <kanie@linux.alibaba.com>
> 
I'm thoroughly in favour but seeing as I'd end up using an LLM
just to figure out what the actual code does no tags from me!

Jonathan

      parent reply	other threads:[~2026-09-25 23:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-24  3:39 [PATCH v2] checkpatch: don't flag ACQUIRE_ERR() assignments in if conditions Guixin Liu
2026-09-24  3:48 ` sashiko-bot
2026-09-24 17:09 ` Joe Perches
2026-09-24 20:14 ` Alison Schofield
2026-09-25 23:09 ` Jonathan Cameron [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260926000933.6d51223e@jic23-hlaptop \
    --to=jic23@kernel.org \
    --cc=alison.schofield@intel.com \
    --cc=apw@canonical.com \
    --cc=joe@perches.com \
    --cc=kanie@linux.alibaba.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox