projects
/
GitHub
/
LineageOS
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
db5c05b
)
[media] fc0011: Fix xin value clamping
author
Michael Büsch
<m@bues.ch>
Thu, 7 Feb 2013 15:16:55 +0000
(12:16 -0300)
committer
Mauro Carvalho Chehab
<mchehab@redhat.com>
Fri, 8 Feb 2013 19:50:33 +0000
(17:50 -0200)
Fix the xin value clamping and use clamp_t().
Signed-off-by: Michael Buesch <m@bues.ch>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/tuners/fc0011.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/media/tuners/fc0011.c
b/drivers/media/tuners/fc0011.c
index 3089f2ebcbfee1d84fd39dc26fbaae5acc363ef2..f87aa5a8b8ea68c6c4f36b2b21c8c49dde5595dc 100644
(file)
--- a/
drivers/media/tuners/fc0011.c
+++ b/
drivers/media/tuners/fc0011.c
@@
-183,8
+183,7
@@
static int fc0011_set_params(struct dvb_frontend *fe)
unsigned int i, vco_retries;
u32 freq = p->frequency / 1000;
u32 bandwidth = p->bandwidth_hz / 1000;
- u32 fvco, xin, xdiv, xdivr;
- u16 frac;
+ u32 fvco, xin, frac, xdiv, xdivr;
u8 fa, fp, vco_sel, vco_cal;
u8 regs[FC11_NR_REGS] = { };
@@
-227,12
+226,8
@@
static int fc0011_set_params(struct dvb_frontend *fe)
frac += 32786;
if (!frac)
xin = 0;
- else if (frac < 511)
- xin = 512;
- else if (frac < 65026)
- xin = frac;
else
- xin =
65024
;
+ xin =
clamp_t(u32, frac, 512, 65024)
;
regs[FC11_REG_XINHI] = xin >> 8;
regs[FC11_REG_XINLO] = xin;