public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: William Breathitt Gray <wbg@kernel.org>
Cc: Haotian Zhang <vulab@iscas.ac.cn>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] counter: 104-quad-8: Fix incorrect return value in IRQ handler
Date: Fri, 12 Dec 2025 17:04:41 +0200	[thread overview]
Message-ID: <aTwvCSJKtC26tK21@smile.fi.intel.com> (raw)
In-Reply-To: <20251212033417.24108-1-wbg@kernel.org>

On Fri, Dec 12, 2025 at 12:34:07PM +0900, William Breathitt Gray wrote:
> On Sun, Dec 07, 2025 at 02:00:07AM +0800, Haotian Zhang wrote:

...

> >  	ret = regmap_read(priv->map, QUAD8_INTERRUPT_STATUS, &status);
> > -	if (ret)
> > -		return ret;
> > +	if (ret) {
> > +		WARN_ONCE(true, "quad8: regmap_read failed: %d\n", ret);
> 
> The warning should indicate the purpose of the operation so users know
> what failed for the hardware. So perhaps "quad8: Attempt to read
> Interrupt Status Register failed: %d\n" is better.
> 
> >  	ret = regmap_write(priv->map, QUAD8_CHANNEL_OPERATION, CLEAR_PENDING_INTERRUPTS);
> > -	if (ret)
> > -		return ret;
> > +	if (ret) {
> > +		WARN_ONCE(true, "quad8: regmap_write failed: %d\n", ret);
> 
> For the same reason as above, perhaps "quad8: Attempt to clear pending
> interrupts by writing to Channel Operation Register failed: %d\n" is
> better.

On top of that, I'm wondering if we can use dev_WARN_ONCE() and drop "quad8: "
prefix.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2025-12-12 15:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <tQ6gupeNR5WXy61K0UZmDNzA2jlqAjibu-EqYV_XRtlg9D0x97yhFy6HUvzN7vLm6DePuDcSVd_qZ_lqin6_8Q==@protonmail.internalid>
2025-12-02  8:39 ` [PATCH] counter: 104-quad-8: Fix incorrect return value in IRQ handler Haotian Zhang
2025-12-06  4:24   ` William Breathitt Gray
2025-12-06 16:30     ` Andy Shevchenko
2025-12-06 18:00   ` [PATCH v2] " Haotian Zhang
2025-12-12  3:34     ` William Breathitt Gray
2025-12-12 15:04       ` Andy Shevchenko [this message]
2025-12-15  2:01   ` [PATCH v3] " Haotian Zhang
2025-12-22 11:06     ` William Breathitt Gray

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=aTwvCSJKtC26tK21@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vulab@iscas.ac.cn \
    --cc=wbg@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