From: Jaswinder Singh Rajput <jaswinder@kernel.org>
To: Paul Mackerras <paulus@samba.org>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
linux-fbdev-devel@lists.sourceforge.net
Subject: [PATCH] aty128fb: move block to where it should be in function aty128_var_to_pll
Date: Sun, 20 Sep 2009 13:44:14 +0530 [thread overview]
Message-ID: <1253434454.19515.10.camel@ht.satnam> (raw)
In function aty128_var_to_pll moving block to where it should be.
This also fixed following compilation warning:
CC [M] drivers/video/aty/aty128fb.o
drivers/video/aty/aty128fb.c: In function ‘aty128_decode_var’:
drivers/video/aty/aty128fb.c:1520: warning: ‘pll.post_divider’ may be used uninitialized in this function
Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
---
drivers/video/aty/aty128fb.c | 33 ++++++++++++++++-----------------
1 files changed, 16 insertions(+), 17 deletions(-)
diff --git a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c
index e4e4d43..fd6746e 100644
--- a/drivers/video/aty/aty128fb.c
+++ b/drivers/video/aty/aty128fb.c
@@ -1328,8 +1328,7 @@ static int aty128_var_to_pll(u32 period_in_ps, struct aty128_pll *pll,
unsigned char post_dividers[] = {1,2,4,8,3,6,12};
u32 output_freq;
u32 vclk; /* in .01 MHz */
- int i = 0;
- u32 n, d;
+ int i;
vclk = 100000000 / period_in_ps; /* convert units to 10 kHz */
@@ -1343,27 +1342,27 @@ static int aty128_var_to_pll(u32 period_in_ps, struct aty128_pll *pll,
for (i = 0; i < ARRAY_SIZE(post_dividers); i++) {
output_freq = post_dividers[i] * vclk;
if (output_freq >= c.ppll_min && output_freq <= c.ppll_max) {
+ u32 n, d;
+
pll->post_divider = post_dividers[i];
- break;
- }
- }
- if (i == ARRAY_SIZE(post_dividers))
- return -EINVAL;
+ /* calculate feedback divider */
+ n = c.ref_divider * output_freq;
+ d = c.ref_clk;
- /* calculate feedback divider */
- n = c.ref_divider * output_freq;
- d = c.ref_clk;
+ pll->feedback_divider = round_div(n, d);
+ pll->vclk = vclk;
- pll->feedback_divider = round_div(n, d);
- pll->vclk = vclk;
+ DBG("post %d feedback %d vlck %d output %d "
+ "ref_divider %d vclk_per: %d\n", pll->post_divider,
+ pll->feedback_divider, vclk, output_freq,
+ c.ref_divider, period_in_ps);
- DBG("post %d feedback %d vlck %d output %d ref_divider %d "
- "vclk_per: %d\n", pll->post_divider,
- pll->feedback_divider, vclk, output_freq,
- c.ref_divider, period_in_ps);
+ return 0;
+ }
+ }
- return 0;
+ return -EINVAL;
}
--
1.6.4.4
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Linux-fbdev-devel mailing list
Linux-fbdev-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-fbdev-devel
next reply other threads:[~2009-09-20 8:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-20 8:14 Jaswinder Singh Rajput [this message]
2009-09-20 22:19 ` [PATCH] aty128fb: move block to where it should be in function aty128_var_to_pll Benjamin Herrenschmidt
2009-09-21 12:57 ` Jaswinder Singh Rajput
2009-09-21 23:51 ` Benjamin Herrenschmidt
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=1253434454.19515.10.camel@ht.satnam \
--to=jaswinder@kernel.org \
--cc=benh@kernel.crashing.org \
--cc=linux-fbdev-devel@lists.sourceforge.net \
--cc=paulus@samba.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;
as well as URLs for NNTP newsgroup(s).