linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Tero Kristo <t-kristo@ti.com>
Cc: Mike Turquette <mturquette@linaro.org>,
	Stephen Boyd <sboyd@codeaurora.org>,
	linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org,
	Brian Hutchinson <b.hutchman@gmail.com>,
	Matthijs van Duin <matthijsvanduin@gmail.com>
Subject: Re: [PATCH 2/3] clk: ti: Implement FAPLL set_rate for the synthesizer
Date: Mon, 23 Mar 2015 08:52:42 -0700	[thread overview]
Message-ID: <20150323155242.GX31346@atomide.com> (raw)
In-Reply-To: <5510143A.8090404@ti.com>

* Tero Kristo <t-kristo@ti.com> [150323 06:25]:
> On 03/23/2015 12:35 AM, Tony Lindgren wrote:
> >+static u32 ti_fapll_synth_set_frac_rate(struct fapll_synth *synth,
> >+					unsigned long rate,
> >+					unsigned long parent_rate)
> >+{
> >+	u32 post_div_m, synth_int_div, synth_frac_div, v;
> >+
> >+	post_div_m = DIV_ROUND_UP_ULL((u64)parent_rate * SYNTH_PHASE_K, rate);
> >+	post_div_m = post_div_m / SYNTH_MAX_INT_DIV;
> >+	if (post_div_m > SYNTH_MAX_DIV_M)
> >+		return -EINVAL;
> >+	if (!post_div_m)
> >+		post_div_m = 1;
> >+
> >+	for (; post_div_m < SYNTH_MAX_DIV_M; post_div_m++) {
> >+		synth_int_div = DIV_ROUND_UP_ULL((u64)parent_rate *
> >+						 SYNTH_PHASE_K *
> >+						 10000000,
> >+						 rate * post_div_m);
> >+		synth_frac_div = synth_int_div % 10000000;
> >+		synth_int_div /= 10000000;
> >+
> >+		if (synth_int_div <= SYNTH_MAX_INT_DIV)
> >+			break;
> >+	}
> >+
> >+	if (synth_int_div > SYNTH_MAX_INT_DIV)
> >+		return -EINVAL;
> >+
> >+	v = readl_relaxed(synth->freq);
> >+	v &= ~0x1fffffff;
> >+	v |= (synth_int_div & SYNTH_MAX_INT_DIV) << 24;
> >+	v |= (synth_frac_div & 0xffffff);
> 
> This code is generating these compile time warnings for me:
> 
>   CC      drivers/clk/ti/fapll.o
> drivers/clk/ti/fapll.c: In function ‘ti_fapll_synth_set_rate’:
> drivers/clk/ti/fapll.c:394:5: warning: ‘synth_int_div’ may be used
> uninitialized in this function [-Wuninitialized]
> drivers/clk/ti/fapll.c:373:18: note: ‘synth_int_div’ was declared here
> drivers/clk/ti/fapll.c:400:23: warning: ‘synth_frac_div’ may be used
> uninitialized in this function [-Wuninitialized]
> drivers/clk/ti/fapll.c:373:33: note: ‘synth_frac_div’ was declared here

Oops thanks will check. I did move this into a separate function
to make it more readable, probably happened at that point.

Regards,

Tony

  reply	other threads:[~2015-03-23 15:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-22 22:35 [PATCH 0/3] Implement set_rate for FAPLL on dm816x Tony Lindgren
2015-03-22 22:35 ` [PATCH 1/3] clk: ti: Fix FAPLL recalc_rate for rounding errors Tony Lindgren
2015-03-22 22:35 ` [PATCH 2/3] clk: ti: Implement FAPLL set_rate for the synthesizer Tony Lindgren
2015-03-23 13:25   ` Tero Kristo
2015-03-23 15:52     ` Tony Lindgren [this message]
2015-03-24 16:37       ` Tony Lindgren
2015-03-24 18:53         ` Tero Kristo
2015-03-22 22:35 ` [PATCH 3/3] clk: ti: Implement FAPLL set_rate for the PLL Tony Lindgren

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=20150323155242.GX31346@atomide.com \
    --to=tony@atomide.com \
    --cc=b.hutchman@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=matthijsvanduin@gmail.com \
    --cc=mturquette@linaro.org \
    --cc=sboyd@codeaurora.org \
    --cc=t-kristo@ti.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;
as well as URLs for NNTP newsgroup(s).