mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hiroshi Doyu <hdoyu@nvidia.com>
To: Peter De Schrijver <pdeschrijver@nvidia.com>
Cc: "linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	Mike Turquette <mturquette@linaro.org>,
	Stephen Warren <swarren@nvidia.com>,
	"Prashant Gaikwad" <pgaikwad@nvidia.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [REPOST PATCH 1/2] clk: add table lookup to mux
Date: Wed, 27 Feb 2013 08:32:13 +0200	[thread overview]
Message-ID: <20130227083213.aa234eea89272b09d6551f78@nvidia.com> (raw)
In-Reply-To: <1361545358-22721-2-git-send-email-pdeschrijver@nvidia.com>

On Fri, 22 Feb 2013 16:02:28 +0100
Peter De Schrijver <pdeschrijver@nvidia.com> wrote:

> Add a table lookup feature to the mux clock. Also allow arbitrary masks
> instead of the width. This will be used by some clocks on Tegra114.
>
> Signed-off-by: Peter De Schrijver <pdeschrijver@nvidia.com>
....
> @@ -42,7 +43,17 @@ static u8 clk_mux_get_parent(struct clk_hw *hw)
>  	 * val = 0x4 really means "bit 2, index starts at bit 0"
>  	 */
....
> +	if (mux->table) {
> +		int i;
> +
> +		for (i = 0; i < num_parents; i++)
> +			if (mux->table[i] == val)
> +				return i;
> +		if (i == num_parents)
> +			return -EINVAL;
> +	}

Can't we just return after for-loop without checking i == num_parents as below?

+		for (i = 0; i < num_parents; i++) {
+			if (mux->table[i] == val)
+				return i;
+		}
+
+		return -EINVAL;

  reply	other threads:[~2013-02-27  6:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-22 15:02 [REPOST PATCH 0/2] Table lookup for mux clock type Peter De Schrijver
2013-02-22 15:02 ` [REPOST PATCH 1/2] clk: add table lookup to mux Peter De Schrijver
2013-02-27  6:32   ` Hiroshi Doyu [this message]
2013-02-22 15:02 ` [REPOST PATCH 2/2] clk: tegra: adapt tegra periph clk to mux table/mask Peter De Schrijver
2013-03-05 22:48 ` [REPOST PATCH 0/2] Table lookup for mux clock type Stephen Warren
2013-03-05 23:52   ` Stephen Warren
2013-03-06  7:52     ` Peter De Schrijver

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=20130227083213.aa234eea89272b09d6551f78@nvidia.com \
    --to=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=pdeschrijver@nvidia.com \
    --cc=pgaikwad@nvidia.com \
    --cc=swarren@nvidia.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

all inboxes | Powered by JetHome®