mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Hiroshi Doyu <hdoyu@nvidia.com>
Cc: Prashant Gaikwad <pgaikwad@nvidia.com>,
	"mturquette@linaro.org" <mturquette@linaro.org>,
	"swarren@wwwdotorg.org" <swarren@wwwdotorg.org>,
	"sboyd@codeaurora.org" <sboyd@codeaurora.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH V2] clk: Add composite clock type
Date: Tue, 5 Feb 2013 11:15:22 +0000	[thread overview]
Message-ID: <20130205111522.GJ17786@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <20130205.122252.570646990867457667.hdoyu@nvidia.com>

On Tue, Feb 05, 2013 at 11:22:52AM +0100, Hiroshi Doyu wrote:
> diff --git a/drivers/clk/clk-composite.c b/drivers/clk/clk-composite.c
> index f30fb4b..8f88805 100644
> --- a/drivers/clk/clk-composite.c
> +++ b/drivers/clk/clk-composite.c
> @@ -27,6 +27,9 @@ static u8 clk_composite_get_parent(struct clk_hw *hw)
>         const struct clk_ops *mux_ops = composite->mux_ops;
>         struct clk_hw *mux_hw = composite->mux_hw;
>  
> +       if (!mux_hw->clk)
> +	       return -EINVAL;
> +
>         mux_hw->clk = hw->clk;

That just looks totally wrong.

Firstly, according to the hunk, this function has the prototype:

static u8 clk_composite_get_parent(struct clk_hw *hw)

What do you think is the effect of passing -EINVAL back as a 'u8' ?

Secondly, the whole "check mux_hw->clk for NULL, and then overwrite it"
looks really really really wrong.  If it's already set, then why does it
need to be changed?  If it isn't set, why do you need to error out?

Thirdly, why is a function called "get_parent" modifying anything (isn't
it supposed to be _get_ing something?

  parent reply	other threads:[~2013-02-05 11:17 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-04  8:11 Prashant Gaikwad
2013-02-04  9:37 ` Hiroshi Doyu
2013-02-05  8:33   ` Prashant Gaikwad
2013-02-05 10:22     ` Hiroshi Doyu
2013-02-05 10:38       ` Tomasz Figa
2013-02-05 11:15       ` Russell King - ARM Linux [this message]
2013-02-06  2:55       ` Prashant Gaikwad
2013-02-06  6:10         ` Hiroshi Doyu
2013-02-06  9:52           ` Prashant Gaikwad
2013-02-06 10:00             ` Hiroshi Doyu
2013-02-06 10:02             ` Tomasz Figa
2013-02-05 10:15 ` Tomasz Figa
2013-02-06  3:04   ` Prashant Gaikwad
2013-02-06 10:06     ` Tomasz Figa
2013-02-28  7:58       ` Prashant Gaikwad
2013-02-28 18:20         ` Stephen Warren
2013-03-13 16:30           ` Tomasz Figa
2013-03-19 12:04             ` Prashant Gaikwad
2013-02-05 10:50 ` Hiroshi Doyu

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=20130205111522.GJ17786@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=hdoyu@nvidia.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=mturquette@linaro.org \
    --cc=pgaikwad@nvidia.com \
    --cc=sboyd@codeaurora.org \
    --cc=swarren@wwwdotorg.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®