[PATCH 2/9] sis fb: test below 0 on unsigned type_no

From: roel kluin
Date: Mon Jul 21 2008 - 20:29:24 EST


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@xxxxxxxxx>
---
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 {
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/