Linux clock framework development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Onur Özkan" <work@onurozkan.dev>
Cc: linux-clk@vger.kernel.org
Subject: Re: [PATCH] clk: devres: make clock cleanup explicit on failure
Date: Fri, 04 Sep 2026 08:01:29 +0000	[thread overview]
Message-ID: <20260904080129.A84381F00A3E@smtp.kernel.org> (raw)
In-Reply-To: <20260904075026.60793-1-work@onurozkan.dev>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Replaces devm_add_action_or_reset() with open-coded error handling to pacify a static analyzer.
--

commit f91fcabb46a07cc1fa1a03a8bac1f236304fd974
Author: Onur Özkan <work@onurozkan.dev>
Subject: clk: devres: make clock cleanup explicit on failure

This commit replaces the standard devm_add_action_or_reset() helper with
devm_add_action() and an explicitly open-coded clock disable and unprepare
sequence on failure. This change was made to address a smatch warning.

Link: https://lore.kernel.org/all/apmUPdYtdIM0dQbF@redhat.com
Closes: https://lore.kernel.org/r/202608090025.dwxdfqFr-lkp@intel.com

> diff --git a/drivers/clk/clk-devres.c b/drivers/clk/clk-devres.c
> index 4cc3863bd7da9..9ed9a7b7b23f4 100644
> --- a/drivers/clk/clk-devres.c
> +++ b/drivers/clk/clk-devres.c
> @@ -123,9 +123,11 @@ struct clk *devm_clk_get_optional_enabled_with_rate(struct device *dev,
>  	if (ret)
>  		goto out_put_clk;
>  
> -	ret = devm_add_action_or_reset(dev, devm_clk_disable_unprepare, clk);
> -	if (ret)
> +	ret = devm_add_action(dev, devm_clk_disable_unprepare, clk);
> +	if (ret) {
> +		clk_disable_unprepare(clk);
>  		goto out_put_clk;
> +	}

[Severity: Low]
Is it necessary to open-code this cleanup logic in
devm_clk_get_optional_enabled_with_rate() just to satisfy a static analyzer?

Replacing standard kernel abstractions like devm_add_action_or_reset() with
manual error handling to pacify a false positive degrades code structure and
reverts the benefits of the devres pattern.

Should the analyzer be fixed instead of open-coding the manual cleanup
sequence here?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260904075026.60793-1-work@onurozkan.dev?part=1

  reply	other threads:[~2026-09-04  8:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-04  7:50 [PATCH] clk: devres: make clock cleanup explicit on failure Onur Özkan
2026-09-04  8:01 ` sashiko-bot [this message]
2026-09-04  8:12   ` Jerome Brunet

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=20260904080129.A84381F00A3E@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=work@onurozkan.dev \
    /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