linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux@armlinux.org.uk>
To: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Cc: david.brown@linaro.org, rafael.j.wysocki@intel.com,
	linux-clk@vger.kernel.org, b.zolnierkie@samsung.com,
	sboyd@kernel.org, mturquette@baylibre.com,
	mazziesaccount@gmail.com, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org, krzk@kernel.org,
	akshu.agrawal@amd.com, cw00.choi@samsung.com,
	djkurtz@chromium.org, pavel@ucw.cz, pombredanne@nexb.com,
	andy.gross@linaro.org, andrew.smirnov@gmail.com,
	lee.jones@linaro.org, sjhuang@iluvatar.ai,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v5 1/9] clkdev: add managed clkdev lookup registration
Date: Mon, 3 Dec 2018 18:06:12 +0000	[thread overview]
Message-ID: <20181203180612.GM30658@n2100.armlinux.org.uk> (raw)
In-Reply-To: <b6c5c110c482ff6a6b2378ab3518bd31c6233872.1543837442.git.matti.vaittinen@fi.rohmeurope.com>

Hi,

On Mon, Dec 03, 2018 at 02:17:56PM +0200, Matti Vaittinen wrote:
> diff --git a/drivers/clk/clkdev.c b/drivers/clk/clkdev.c
> index 9ab3db8b3988..68a1e55a60d2 100644
> --- a/drivers/clk/clkdev.c
> +++ b/drivers/clk/clkdev.c
> @@ -401,6 +401,25 @@ static struct clk_lookup *__clk_register_clkdev(struct clk_hw *hw,
>  	return cl;
>  }
>  
> +static int do_clk_register_clkdev(struct clk_hw *hw,
> +	struct clk_lookup **cl, const char *con_id, const char *dev_id)
> +{
> +

No need for this blank line.

> +	if (IS_ERR(hw))
> +		return PTR_ERR(hw);
> +	/*
> +	 * Since dev_id can be NULL, and NULL is handled specially, we must
> +	 * pass it as either a NULL format string, or with "%s".
> +	 */
> +	if (dev_id)
> +		*cl = __clk_register_clkdev(hw, con_id, "%s",
> +					   dev_id);

Please move "dev_id);" onto the line above.

> @@ -420,20 +439,10 @@ int clk_register_clkdev(struct clk *clk, const char *con_id,
>  {
>  	struct clk_lookup *cl;
>  
> -	if (IS_ERR(clk))
> -		return PTR_ERR(clk);
> -
> -	/*
> -	 * Since dev_id can be NULL, and NULL is handled specially, we must
> -	 * pass it as either a NULL format string, or with "%s".
> -	 */
> -	if (dev_id)
> -		cl = __clk_register_clkdev(__clk_get_hw(clk), con_id, "%s",
> -					   dev_id);
> -	else
> -		cl = __clk_register_clkdev(__clk_get_hw(clk), con_id, NULL);
> -
> -	return cl ? 0 : -ENOMEM;
> +	if (!IS_ERR(clk))
> +		return do_clk_register_clkdev(__clk_get_hw(clk), &cl, con_id,
> +					      dev_id);
> +	return PTR_ERR(clk);

Please keep this as:

	if (IS_ERR(clk))
		return PTR_ERR(clk);

	return do_clk_register_clkdev(__clk_get_hw(clk), &cl, con_id,
				      dev_id);

rather than inverting it - it makes it more consistent with code elsewhere.

> +static int devm_clk_match_clkdev(struct device *dev, void *res, void *data)
> +{
> +	struct clk_lookup **l = res;
> +
> +	if (!l || !*l) {
> +		WARN_ON(!l || !*l);

How can "l" be NULL here?  How can *l be NULL?

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up
According to speedtest.net: 11.9Mbps down 500kbps up

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2018-12-03 18:09 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-03 12:17 [PATCH v5 0/9] clk: clkdev: managed clk lookup and provider registrations Matti Vaittinen
2018-12-03 12:17 ` [PATCH v5 1/9] clkdev: add managed clkdev lookup registration Matti Vaittinen
2018-12-03 18:06   ` Russell King - ARM Linux [this message]
2018-12-04  8:03     ` Matti Vaittinen
2018-12-03 12:18 ` [PATCH v5 2/9] clk: of_clk - add managed provider registrations Matti Vaittinen
2018-12-03 12:19 ` [PATCH v5 3/9] clk: clk-max77686: Clean clkdev lookup leak and use devm Matti Vaittinen
2018-12-03 12:19 ` [PATCH v5 0/9] clk: clkdev: managed clk lookup and provider registrations Lee Jones
2018-12-03 12:35   ` Matti Vaittinen
2018-12-03 12:56     ` Lee Jones
2018-12-03 12:20 ` [PATCH v5 4/9] clk: clk-st: avoid clkdev lookup leak at remove Matti Vaittinen
2018-12-03 12:20 ` [PATCH v5 5/9] clk: clk-hi655x: Free of_provider " Matti Vaittinen
2018-12-03 12:21 ` [PATCH v5 6/9] clk: rk808: use managed version of of_provider registration Matti Vaittinen
2018-12-03 12:22 ` [PATCH v5 7/9] clk: clk-twl6040: Free of_provider at remove Matti Vaittinen
2018-12-03 12:23 ` [PATCH v5 8/9] clk: apcs-msm8916: simplify probe cleanup by using devm Matti Vaittinen
2018-12-03 12:23 ` [PATCH v5 9/9] clk: bd718x7: Initial support for ROHM bd71837/bd71847 PMIC clock Matti Vaittinen

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=20181203180612.GM30658@n2100.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=akshu.agrawal@amd.com \
    --cc=andrew.smirnov@gmail.com \
    --cc=andy.gross@linaro.org \
    --cc=b.zolnierkie@samsung.com \
    --cc=cw00.choi@samsung.com \
    --cc=david.brown@linaro.org \
    --cc=djkurtz@chromium.org \
    --cc=krzk@kernel.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matti.vaittinen@fi.rohmeurope.com \
    --cc=mazziesaccount@gmail.com \
    --cc=mturquette@baylibre.com \
    --cc=pavel@ucw.cz \
    --cc=pombredanne@nexb.com \
    --cc=rafael.j.wysocki@intel.com \
    --cc=sboyd@kernel.org \
    --cc=sjhuang@iluvatar.ai \
    /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;
as well as URLs for NNTP newsgroup(s).