From: roel kluin <roel.kluin@gmail.com>
To: thomas@winischhofer.net
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 2/9] sis fb: test below 0 on unsigned type_no
Date: Mon, 21 Jul 2008 20:29:02 -0400 [thread overview]
Message-ID: <488529CE.1040907@gmail.com> (raw)
u32 type_no, member of structs sis_{crt2,tv}type are unsigned,
so assignment of -1 and subsequent tests fail
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/drivers/video/sis/sis_main.c b/drivers/video/sis/sis_main.c
index b934384..9ec6c0e 100644
--- a/drivers/video/sis/sis_main.c
+++ b/drivers/video/sis/sis_main.c
@@ -266,7 +266,7 @@ sisfb_search_crt2type(const char *name)
if(name == NULL) return;
- while(sis_crt2type[i].type_no != -1) {
+ while (sis_crt2type[i].type_no != ~0) {
if(!strnicmp(name, sis_crt2type[i].name, strlen(sis_crt2type[i].name))) {
sisfb_crt2type = sis_crt2type[i].type_no;
sisfb_tvplug = sis_crt2type[i].tvplug_no;
@@ -293,7 +293,7 @@ sisfb_search_tvstd(const char *name)
if(name == NULL)
return;
- while(sis_tvtype[i].type_no != -1) {
+ while (sis_tvtype[i].type_no != ~0) {
if(!strnicmp(name, sis_tvtype[i].name, strlen(sis_tvtype[i].name))) {
sisfb_tvstd = sis_tvtype[i].type_no;
break;
diff --git a/drivers/video/sis/sis_main.h b/drivers/video/sis/sis_main.h
index 3e3b7fa..5421bf2 100644
--- a/drivers/video/sis/sis_main.h
+++ b/drivers/video/sis/sis_main.h
@@ -390,7 +390,7 @@ static struct _sis_crt2type {
{"YPBPR1080I", CRT2_TV, TV_YPBPR|TV_YPBPR1080I, FL_315},
{"DSTN", CRT2_LCD, -1, FL_315|FL_550_DSTN},
{"FSTN", CRT2_LCD, -1, FL_315|FL_550_FSTN},
- {"\0", -1, -1, 0}
+ {"\0", ~0, -1, 0}
};
/* TV standard */
@@ -403,7 +403,7 @@ static struct _sis_tvtype {
{"PALM", TV_PAL|TV_PALM},
{"PALN", TV_PAL|TV_PALN},
{"NTSCJ", TV_NTSC|TV_NTSCJ},
- {"\0", -1}
+ {"\0", ~0}
};
static const struct _sis_vrate {
reply other threads:[~2008-07-22 0:29 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=488529CE.1040907@gmail.com \
--to=roel.kluin@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=thomas@winischhofer.net \
/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