mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mingwei Zheng <zmw12306@gmail.com>
To: "Uwe Kleine-König" <ukleinek@kernel.org>
Cc: fabrice.gasnier@foss.st.com, coquelin.stm32@gmail.com,
	alexandre.torgue@foss.st.com, thierry.reding@gmail.com,
	lee@kernel.org, linux-pwm@vger.kernel.org,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Jiasheng Jiang <jiashengjiangcool@gmail.com>
Subject: Re: [PATCH] pwm: stm32-lp: Add check for clk_enable()
Date: Thu, 5 Dec 2024 19:51:00 -0500	[thread overview]
Message-ID: <5778D1D6-9C2B-4456-9765-213120076C62@gmail.com> (raw)
In-Reply-To: <geyicxufezkbu7cdvnbgnr2qeuwrn5ubz5ent3spk5biuozxrs@gsqx2chgiiot>



> On Dec 5, 2024, at 3:34 AM, Uwe Kleine-König <ukleinek@kernel.org> wrote:
> 
> On Thu, Dec 05, 2024 at 12:17:46AM -0500, Mingwei Zheng wrote:
>> Add check for the return value of clk_enable() to catch the potential
>> error.
> 
> Is this something that you actually hit, or just a janitoral fix you
> noticed while browsing the code (or reading some checker output)?

We detected this through static analysis, instead of actually hit.

> 
>> Fixes: e70a540b4e02 ("pwm: Add STM32 LPTimer PWM driver")
>> Signed-off-by: Mingwei Zheng <zmw12306@gmail.com>
>> Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
>> ---
>> drivers/pwm/pwm-stm32-lp.c | 8 ++++++--
>> 1 file changed, 6 insertions(+), 2 deletions(-)
>> 
>> diff --git a/drivers/pwm/pwm-stm32-lp.c b/drivers/pwm/pwm-stm32-lp.c
>> index 989731256f50..4abef304417d 100644
>> --- a/drivers/pwm/pwm-stm32-lp.c
>> +++ b/drivers/pwm/pwm-stm32-lp.c
>> @@ -163,12 +163,16 @@ static int stm32_pwm_lp_get_state(struct pwm_chip *chip,
>> unsigned long rate = clk_get_rate(priv->clk);
>> u32 val, presc, prd;
>> u64 tmp;
>> + int ret;
> 
> Please move this variable to the block where it's used. No need for such
> a big scope.
> 
> Otherwise looks fine.
> 
> Best regards
> Uwe

Thank you! We will submit a v2 patch for you to review!

Best,
Mingwei


      reply	other threads:[~2024-12-06  0:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-05  5:17 Mingwei Zheng
2024-12-05  8:34 ` Uwe Kleine-König
2024-12-06  0:51   ` Mingwei Zheng [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=5778D1D6-9C2B-4456-9765-213120076C62@gmail.com \
    --to=zmw12306@gmail.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=coquelin.stm32@gmail.com \
    --cc=fabrice.gasnier@foss.st.com \
    --cc=jiashengjiangcool@gmail.com \
    --cc=lee@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=thierry.reding@gmail.com \
    --cc=ukleinek@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

all inboxes | Powered by JetHome®