From: Adrian Bunk <bunk@stusta.de>
To: Hans Verkuil <hverkuil@xs4all.nl>, mchehab@infradead.org
Cc: v4l-dvb-maintainer@linuxtv.org, linux-kernel@vger.kernel.org
Subject: drivers/media/video/tvp5150.c:tvp5150_selmux() looks wrong
Date: Tue, 15 Aug 2006 01:33:00 +0200 [thread overview]
Message-ID: <20060814233300.GA3543@stusta.de> (raw)
The Coverity checker spotted this very strange code introduced by commit
c7c0b34c27bbf0671807e902fbfea6270c8f138d:
<-- snip -->
...
static inline void tvp5150_selmux(struct i2c_client *c)
{
int opmode=0;
struct tvp5150 *decoder = i2c_get_clientdata(c);
int input = 0;
if ((decoder->route.output & TVP5150_BLACK_SCREEN) || !decoder->enable)
input = 8;
switch (input) {
case TVP5150_COMPOSITE1:
input |= 2;
/* fall through */
case TVP5150_COMPOSITE0:
opmode=0x30; /* TV Mode */
break;
case TVP5150_SVIDEO:
default:
input |= 1;
opmode=0; /* Auto Mode */
break;
}
tvp5150_write(c, TVP5150_OP_MODE_CTL, opmode);
tvp5150_write(c, TVP5150_VD_IN_SRC_SEL_1, input);
};
...
<-- snip -->
What is done with "input" looks really buggy (e.g. it's either 0 or 8
and the switch checks for 0, 1, 2).
cu
Adrian
--
Gentoo kernels are 42 times more popular than SUSE kernels among
KLive users (a service by SUSE contractor Andrea Arcangeli that
gathers data about kernels from many users worldwide).
There are three kinds of lies: Lies, Damn Lies, and Statistics.
Benjamin Disraeli
reply other threads:[~2006-08-14 23:33 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20060814233300.GA3543@stusta.de \
--to=bunk@stusta.de \
--cc=hverkuil@xs4all.nl \
--cc=linux-kernel@vger.kernel.org \
--cc=mchehab@infradead.org \
--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