summaryrefslogtreecommitdiff
path: root/linux/drivers/media
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2009-01-29 10:57:25 -0200
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-01-29 10:57:25 -0200
commitc397fe6b033be4e7829a44325cb06a0852d5a6bd (patch)
tree2bb2b8ac7859a53c1c47985d4e008b7d2da5a5d6 /linux/drivers/media
parent7c0917f006a519be5e54c6405f54dea61ca06b7a (diff)
parent27b887c94f4f9a8e646d1915fe86783153b01f80 (diff)
downloadmediapointer-dvb-s2-c397fe6b033be4e7829a44325cb06a0852d5a6bd.tar.gz
mediapointer-dvb-s2-c397fe6b033be4e7829a44325cb06a0852d5a6bd.tar.bz2
merge: backport
From: Mauro Carvalho Chehab <mchehab@redhat.com> Priority: normal Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'linux/drivers/media')
-rw-r--r--linux/drivers/media/dvb/frontends/stb0899_algo.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/linux/drivers/media/dvb/frontends/stb0899_algo.c b/linux/drivers/media/dvb/frontends/stb0899_algo.c
index 71037dc67..3d13968a7 100644
--- a/linux/drivers/media/dvb/frontends/stb0899_algo.c
+++ b/linux/drivers/media/dvb/frontends/stb0899_algo.c
@@ -467,14 +467,13 @@ static void next_sub_range(struct stb0899_state *state)
if (internal->sub_dir > 0) {
old_sub_range = internal->sub_range;
- if (internal->tuner_offst + internal->sub_range / 2 >=
- internal->srch_range / 2)
- internal->sub_range = 0;
- else
- internal->sub_range = MIN((internal->srch_range / 2) -
+ internal->sub_range = MIN((internal->srch_range / 2) -
(internal->tuner_offst + internal->sub_range / 2),
internal->sub_range);
+ if (internal->sub_range < 0)
+ internal->sub_range = 0;
+
internal->tuner_offst += (old_sub_range + internal->sub_range) / 2;
}