Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
From: Bjorn Andersson <andersson@kernel.org>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: Konrad Dybcio <konrad.dybcio@linaro.org>,
	Andy Gross <agross@kernel.org>,
	Marijn Suijten <marijn.suijten@somainline.org>,
	linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] soc: qcom: icc-bwmon: Don't ignore return values of regmap functions
Date: Tue, 20 Jun 2023 11:14:51 -0700	[thread overview]
Message-ID: <20230620181451.idesqpkdyb2wa65l@ripper> (raw)
In-Reply-To: <3364339a-908d-7ab6-7d62-a05ab8e67739@linaro.org>

On Thu, Jun 15, 2023 at 11:26:13PM +0200, Krzysztof Kozlowski wrote:
> On 15/06/2023 23:12, Konrad Dybcio wrote:
> > As it turns out, not all regmap accesses succeed. Not knowing this is
> > particularly suboptimal when there's a breaking change to the regmap
> > APIs. Monitor the return values of regmap_ calls and propagate errors,
> > should any occur.
> > 
> > To keep any level of readability in bwmon_enable(), add some comments
> > to separate the logical blocks.
> > 
> > Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> 
> Nice coincidence, I just had some talks with a friend about uselessness
> (IMHO) of regmap MMIO return status checks.
> 
> Sorry, for me most of this makes the code difficult to read for no gain.
> Errors are not real. This is some artificial problem. Solving it makes
> code less maintainable.
> 
> If we used here readl/writel, you would not add any checks, right? Then
> don't add for regmap mmio.
> 

I agree, the mmio regmap interface should only fail because of bugs or
things are misconfigured. Would be nice to capture that in a WARN_ON()
or something...

Regards,
Bjorn

  reply	other threads:[~2023-06-20 18:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-15 21:12 [PATCH] soc: qcom: icc-bwmon: Don't ignore return values of regmap functions Konrad Dybcio
2023-06-15 21:26 ` Krzysztof Kozlowski
2023-06-20 18:14   ` Bjorn Andersson [this message]
2023-06-20 18:15     ` Krzysztof Kozlowski
2023-06-20 18:59       ` Konrad Dybcio

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=20230620181451.idesqpkdyb2wa65l@ripper \
    --to=andersson@kernel.org \
    --cc=agross@kernel.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marijn.suijten@somainline.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