Linux clock framework development
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@kernel.org>
To: Julia Lawall <Julia.Lawall@inria.fr>,
	Nicolas Palix <nicolas.palix@imag.fr>,
	Phil Edworthy <phil.edworthy@renesas.com>
Cc: Phil Edworthy <phil.edworthy@renesas.com>,
	Michael Turquette <mturquette@baylibre.com>,
	linux-clk@vger.kernel.org, cocci@inria.fr
Subject: Re: [RFC] coccinelle: Add test for unnecessary check before calling clk_disable_unprepare()
Date: Wed, 18 May 2022 11:33:12 -0700	[thread overview]
Message-ID: <20220518183314.112E7C385A9@smtp.kernel.org> (raw)
In-Reply-To: <20220517133556.6934-1-phil.edworthy@renesas.com>

Quoting Phil Edworthy (2022-05-17 06:35:56)
> The clk_disable_unprepare() function only calls clk_disable() and
> clk_unprepare(). Both of these functions already check the clk ptr
> passed in using the IS_ERR_OR_NULL macro. Many drivers already omit
> any checks on the clk ptr, so it is safe to assume this is true for
> all call sites.

Skipping the check for NULL makes sense to me because a NULL clk pointer
is still a valid clk. I'm not so sure about IS_ERR() though. Do the
various implementations of clk_disable() and clk_unprepare() check for
IS_ERR() there?

  reply	other threads:[~2022-05-18 18:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-17 13:35 [RFC] coccinelle: Add test for unnecessary check before calling clk_disable_unprepare() Phil Edworthy
2022-05-18 18:33 ` Stephen Boyd [this message]
2022-05-18 19:05   ` Phil Edworthy
     [not found] ` <c1d5d00d-d770-530b-abfa-0c1f462e5f22@web.de>
2022-05-20 13:57   ` [cocci] " Phil Edworthy
     [not found]     ` <46c9b89a-a97f-1955-e231-de42be1d8e35@web.de>
2022-05-20 16:01       ` Phil Edworthy

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=20220518183314.112E7C385A9@smtp.kernel.org \
    --to=sboyd@kernel.org \
    --cc=Julia.Lawall@inria.fr \
    --cc=cocci@inria.fr \
    --cc=linux-clk@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=nicolas.palix@imag.fr \
    --cc=phil.edworthy@renesas.com \
    /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