From: roel kluin <roel.kluin@gmail.com>
To: hverkuil@xs4all.nl, ivtv-devel@ivtvdriver.org,
video4linux-list@redhat.com
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 3/9] ivtv: test below 0 on unsigned has_ir
Date: Mon, 21 Jul 2008 20:29:08 -0400 [thread overview]
Message-ID: <488529D4.10007@gmail.com> (raw)
u32 has_ir, member of struct tveeprom is unsigned,
so assignment of -1 and subsequent tests fail
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/drivers/media/video/ivtv/ivtv-driver.c b/drivers/media/video/ivtv/ivtv-driver.c
index 797e636..7d909f9 100644
--- a/drivers/media/video/ivtv/ivtv-driver.c
+++ b/drivers/media/video/ivtv/ivtv-driver.c
@@ -465,7 +465,7 @@ static void ivtv_process_eeprom(struct ivtv *itv)
itv->options.radio = (tv.has_radio != 0);
/* only enable newi2c if an IR blaster is present */
/* FIXME: for 2.6.20 the test against 2 should be removed */
- if (itv->options.newi2c == -1 && tv.has_ir != -1 && tv.has_ir != 2) {
+ if (itv->options.newi2c == -1 && tv.has_ir != ~0 && tv.has_ir != 2) {
itv->options.newi2c = (tv.has_ir & 2) ? 1 : 0;
if (itv->options.newi2c) {
IVTV_INFO("Reopen i2c bus for IR-blaster support\n");
diff --git a/drivers/media/video/tveeprom.c b/drivers/media/video/tveeprom.c
index 9da0e18..41c22a7 100644
--- a/drivers/media/video/tveeprom.c
+++ b/drivers/media/video/tveeprom.c
@@ -483,7 +483,7 @@ void tveeprom_hauppauge_analog(struct i2c_client *c, struct tveeprom *tvee,
tvee->has_radio = eeprom_data[i+len-1];
/* old style tag, don't know how to detect
IR presence, mark as unknown. */
- tvee->has_ir = -1;
+ tvee->has_ir = ~0;
tvee->model =
eeprom_data[i+8] +
(eeprom_data[i+9] << 8);
@@ -703,7 +703,7 @@ void tveeprom_hauppauge_analog(struct i2c_client *c, struct tveeprom *tvee,
tveeprom_info("decoder processor is %s (idx %d)\n",
STRM(decoderIC, tvee->decoder_processor),
tvee->decoder_processor);
- if (tvee->has_ir == -1)
+ if (tvee->has_ir == ~0)
tveeprom_info("has %sradio\n",
tvee->has_radio ? "" : "no ");
else
next reply other threads:[~2008-07-22 0:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-22 0:29 roel kluin [this message]
2008-07-22 4:50 ` [PATCH 3/9] ivtv: test below 0 on unsigned has_ir Hans Verkuil
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=488529D4.10007@gmail.com \
--to=roel.kluin@gmail.com \
--cc=hverkuil@xs4all.nl \
--cc=ivtv-devel@ivtvdriver.org \
--cc=linux-kernel@vger.kernel.org \
--cc=video4linux-list@redhat.com \
/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