From: Adrian Bunk <bunk@kernel.org>
To: Patrick Boettcher <pboettcher@dibcom.fr>,
Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: v4l-dvb-maintainer@linuxtv.org, linux-kernel@vger.kernel.org
Subject: DVB: BANDWIDTH_TO_KHZ strangeness
Date: Sun, 14 Oct 2007 19:50:55 +0200 [thread overview]
Message-ID: <20071014175055.GJ4211@stusta.de> (raw)
drivers/media/dvb/frontends/dibx000_common.h contains:
<-- snip -->
...
#define BANDWIDTH_TO_KHZ(v) ( (v) == BANDWIDTH_8_MHZ ? 8000 : \
(v) == BANDWIDTH_7_MHZ ? 7000 : \
(v) == BANDWIDTH_6_MHZ ? 6000 : 8000 )
...
<-- snip -->
Commit b6884a17fc70e979ef34e4b5560988b522bb50a0 added to both of
drivers/media/dvb/frontends/dib7000{m,p}.c:
<-- snip -->
...
factor = BANDWIDTH_TO_KHZ(ch->u.ofdm.bandwidth);
if (factor >= 5000)
factor = 1;
else
factor = 6;
...
<-- snip -->
factor < 5000 is obviously never possible.
drivers/media/dvb/frontends/dib0070.c contains a similar assumption that
BANDWIDTH_TO_KHZ() could result in values other than {6,7,8}000
(I haven't checked whether there are more such assumptions in other
places).
Spotted by the Coverity checker.
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
next reply other threads:[~2007-10-14 17:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-14 17:50 Adrian Bunk [this message]
2007-10-22 15:10 ` [v4l-dvb-maintainer] DVB: BANDWIDTH_TO_KHZ strangeness Patrick Boettcher
2007-10-22 18:29 ` Mauro Carvalho Chehab
2007-10-22 19:54 ` Adrian Bunk
2007-10-22 20:02 ` Mauro Carvalho Chehab
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=20071014175055.GJ4211@stusta.de \
--to=bunk@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mchehab@infradead.org \
--cc=pboettcher@dibcom.fr \
--cc=v4l-dvb-maintainer@linuxtv.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