public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Antony Kurniawan Soemardi <linux@smankusors.com>
Cc: "Bjorn Andersson" <andersson@kernel.org>,
	"Konrad Dybcio" <konradybcio@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Jonathan Cameron" <jic23@kernel.org>,
	"David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org,
	phone-devel@vger.kernel.org
Subject: Re: [PATCH 2/2] iio: adc: qcom-pm8xxx-xoadc: add support for reading channel labels
Date: Sun, 29 Mar 2026 14:54:38 +0300	[thread overview]
Message-ID: <ackS_tM2P6lp5eoF@ashevche-desk.local> (raw)
In-Reply-To: <c8e6166f-e9fc-430e-b290-a97c2aae2b31@smankusors.com>

On Fri, Mar 27, 2026 at 07:05:04PM +0000, Antony Kurniawan Soemardi wrote:
> On 3/27/2026 2:04 AM, Andy Shevchenko wrote:
> > On Thu, Mar 26, 2026 at 12:00:52PM +0000, Antony Kurniawan Soemardi wrote:
> > > On 3/26/2026 5:18 PM, Andy Shevchenko wrote:

...

> > > > > +	if (!ch) {
> > > > > +		dev_err(adc->dev, "no such channel %lu\n", chan->address);
> > > > > +		return -EINVAL;
> > > > > +	}
> > > > 
> > > > Isn't it a dead code? Also poisoning dmesg with this recurrent message is
> > > > not good idea to begin with (the user space will have a door to flood it,
> > > > which might be considered as an assistance to hackers to clear immediate
> > > > logs after a successful attack).
> > > 
> > > Good point about the successful attack hint! I was copying the existing
> > > code from pm8xxx_read_raw. Do you think those checks are unnecessary for
> > > pm8xxx_read_raw as well?
> > 
> > Yes, I think they are not as the returned code should be enough to identify
> > the problem. (For no such channel I would rather see -ENOENT, but we can't
> > simply replace that in the existing code as it's part of ABI.)
> 
> Just to re-clarify, do you mean for both pm8xxx_read_label &
> pm8xxx_read_raw:
> 1. if the check fails, it should only return -EINVAL without any
>    logging; or
> 2. remove the checks because there's no way it's not found?

The first one. And yeah, -EINVAL in the both cases for the sake of consistency.

-- 
With Best Regards,
Andy Shevchenko



      reply	other threads:[~2026-03-29 11:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-25 21:02 [PATCH 0/2] iio: adc: qcom-pm8xxx-xoadc: add support for reading channel labels from DT Antony Kurniawan Soemardi
2026-03-25 21:02 ` [PATCH 1/2] ARM: dts: qcom: pm8921: add labels for ADC channels Antony Kurniawan Soemardi
2026-03-26 11:01   ` Konrad Dybcio
2026-03-25 21:02 ` [PATCH 2/2] iio: adc: qcom-pm8xxx-xoadc: add support for reading channel labels Antony Kurniawan Soemardi
2026-03-26 10:18   ` Andy Shevchenko
2026-03-26 12:00     ` Antony Kurniawan Soemardi
2026-03-26 19:04       ` Andy Shevchenko
2026-03-27 19:05         ` Antony Kurniawan Soemardi
2026-03-29 11:54           ` Andy Shevchenko [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=ackS_tM2P6lp5eoF@ashevche-desk.local \
    --to=andriy.shevchenko@intel.com \
    --cc=andersson@kernel.org \
    --cc=andy@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=konradybcio@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@smankusors.com \
    --cc=nuno.sa@analog.com \
    --cc=phone-devel@vger.kernel.org \
    --cc=robh@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