[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20070615204047.GI3588@stusta.de>
Date: Fri, 15 Jun 2007 22:40:47 +0200
From: Adrian Bunk <bunk@...sta.de>
To: Hartmut Birr <e9hack@...glemail.com>,
Georg Acher <acher@...tum.de>,
Oliver Endriss <o.endriss@....de>,
Mauro Carvalho Chehab <mchehab@...radead.org>
Cc: linux-kernel@...r.kernel.org, v4l-dvb-maintainer@...uxtv.org
Subject: drivers/media/dvb/frontends/tda10023.c: buggy (dead) code
The Coverity checker spotted the following buggy code in
drivers/media/dvb/frontends/tda10023.c:
<-- snip -->
...
#define XTAL 28920000UL
#define PLL_M 8UL
#define PLL_P 4UL
#define PLL_N 1UL
#define SYSCLK (XTAL*PLL_M/(PLL_N*PLL_P)) // -> 57840000
...
static int tda10023_set_symbolrate (struct tda10023_state* state, u32 sr)
{
...
if (sr<870000)
sr=870000;
if (sr < (u32)(SYSCLK/98.40)) {
NDEC=3;
SFIL=1;
} else if (sr<(u32)(SYSCLK/64.0)) {
NDEC=3;
SFIL=0;
} else if (sr<(u32)(SYSCLK/49.2)) {
NDEC=2;
SFIL=1;
} else if (sr<(u32)(SYSCLK/32.0)) {
NDEC=2;
SFIL=0;
} else if (sr<(u32)(SYSCLK/24.6)) {
NDEC=1;
SFIL=1;
} else if (sr<(u32)(SYSCLK/16.0)) {
NDEC=1;
SFIL=0;
} else if (sr<(u32)(SYSCLK/12.3)) {
NDEC=0;
SFIL=1;
}
...
}
...
<-- snip -->
57840000 / 98.40 = 587804 < 870000
cu
Adrian
--
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists