From 27b887c94f4f9a8e646d1915fe86783153b01f80 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 29 Jan 2009 10:56:56 -0200 Subject: backport changes on stb0899_algo per request From: Mauro Carvalho Chehab Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/dvb/frontends/stb0899_algo.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'linux/drivers/media') 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; } -- cgit v1.2.3