Skip to contentSkip to conversation

compiler warnings in framebuffer drivers

PATCH New René Scharfe 1 participant 1 message Nov 14, 2001 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 compiler warnings in framebuffer drivers

Hi,

this patch removes all those compiler warnings that were introduced with the anti-strtok patch some time ago. It's against kernel 2.4.15-pre4. I sent you similar ones but it seems they got lost. Which makes me
suspicious: is there something wrong with this patch that prevents it from being applied?

OK, additionally to adding some parentheses this patch corrects a minor issue by inserting code like this at appropriate places:

+ if (!*this_opt)
+ continue;

This lets the parameter parsing code skip over empty tokens, just like strtok did implicitely. It's purely cosmetic - I'd send you a patch without this 'feature', if you like.

Patch is untested, but at least it compiles. Please, apply.

René

drivers/video/acornfb.c +1 -1
diff -Nur linux-2.4.15-pre4/drivers/video/acornfb.c linux-2.4.15-pre4-rs/drivers/video/acornfb.c
@@ -1528,7 +1528,7 @@
 
 	acornfb_init_fbinfo();
 
-	while (opt = strsep(&options, ",")) {
+	while ((opt = strsep(&options, ",")) != NULL) {
 		if (!*opt)
 			continue;
 
drivers/video/amifb.c +3 -1
diff -Nur linux-2.4.15-pre4/drivers/video/amifb.c linux-2.4.15-pre4-rs/drivers/video/amifb.c
@@ -1192,7 +1192,9 @@
 	if (!options || !*options)
 		return 0;
 
-	while (this_opt = strsep(&options, ",")) {
+	while ((this_opt = strsep(&options, ",")) != NULL) {
+		if (!*this_opt)
+			continue;
 		if (!strcmp(this_opt, "inverse")) {
 			amifb_inverse = 1;
 			fb_invert_cmaps();
drivers/video/controlfb.c +1 -1
diff -Nur linux-2.4.15-pre4/drivers/video/controlfb.c linux-2.4.15-pre4-rs/drivers/video/controlfb.c
@@ -1423,7 +1423,7 @@
 	if (!options || !*options)
 		return;
 
-	while (this_opt = strsep(&options, ",")) {
+	while ((this_opt = strsep(&options, ",")) != NULL) {
 		if (!strncmp(this_opt, "font:", 5)) {
 			char *p;
 			int i;
drivers/video/cyberfb.c +3 -1
diff -Nur linux-2.4.15-pre4/drivers/video/cyberfb.c linux-2.4.15-pre4-rs/drivers/video/cyberfb.c
@@ -1022,7 +1022,9 @@
 		return 0;
 	}
 
-	while (this_opt = strsep(&options, ",")) {
+	while ((this_opt = strsep(&options, ",")) != NULL) {
+		if (!*this_opt)
+			continue;
 		if (!strcmp(this_opt, "inverse")) {
 			Cyberfb_inverse = 1;
 			fb_invert_cmaps();
drivers/video/fm2fb.c +1 -1
diff -Nur linux-2.4.15-pre4/drivers/video/fm2fb.c linux-2.4.15-pre4-rs/drivers/video/fm2fb.c
@@ -430,7 +430,7 @@
     if (!options || !*options)
 	return 0;
 
-    while (this_opt = strsep(&options, ",")) {
+    while ((this_opt = strsep(&options, ",")) != NULL) {
 	if (!strncmp(this_opt, "pal", 3))
 	    fm2fb_mode = FM2FB_MODE_PAL;
 	else if (!strncmp(this_opt, "ntsc", 4))
drivers/video/igafb.c +1 -1
diff -Nur linux-2.4.15-pre4/drivers/video/igafb.c linux-2.4.15-pre4-rs/drivers/video/igafb.c
@@ -773,7 +773,7 @@
     if (!options || !*options)
         return 0;
 
-    while (this_opt = strsep(&options, ",")) {
+    while ((this_opt = strsep(&options, ",")) != NULL) {
         if (!strncmp(this_opt, "font:", 5)) {
                 char *p;
                 int i;
drivers/video/imsttfb.c +1 -1
diff -Nur linux-2.4.15-pre4/drivers/video/imsttfb.c linux-2.4.15-pre4-rs/drivers/video/imsttfb.c
@@ -1977,7 +1977,7 @@
 	if (!options || !*options)
 		return 0;
 
-	while (this_opt = strsep(&options, ",")) {
+	while ((this_opt = strsep(&options, ",")) != NULL) {
 		if (!strncmp(this_opt, "font:", 5)) {
 			char *p;
 			int i;
drivers/video/macfb.c +1 -1
diff -Nur linux-2.4.15-pre4/drivers/video/macfb.c linux-2.4.15-pre4-rs/drivers/video/macfb.c
@@ -848,7 +848,7 @@
 	if (!options || !*options)
 		return;
 	
-	while (this_opt = strsep(&options, ",")) {
+	while ((this_opt = strsep(&options, ",")) != NULL) {
 		if (!*this_opt) continue;
 		
 		if (! strcmp(this_opt, "inverse"))
drivers/video/matrox/matroxfb_base.c +1 -1
diff -Nur linux-2.4.15-pre4/drivers/video/matrox/matroxfb_base.c linux-2.4.15-pre4-rs/drivers/video/matrox/matroxfb_base.c
@@ -2372,7 +2372,7 @@
 	if (!options || !*options)
 		return 0;
 
-	while (this_opt = strsep(&options, ",")) {
+	while ((this_opt = strsep(&options, ",")) != NULL) {
 		if (!*this_opt) continue;
 
 		dprintk("matroxfb_setup: option %s\n", this_opt);
drivers/video/platinumfb.c +1 -1
diff -Nur linux-2.4.15-pre4/drivers/video/platinumfb.c linux-2.4.15-pre4-rs/drivers/video/platinumfb.c
@@ -841,7 +841,7 @@
 	if (!options || !*options)
 		return 0;
 
-	while (this_opt = strsep(&options, ",")) {
+	while ((this_opt = strsep(&options, ",")) != NULL) {
 		if (!strncmp(this_opt, "font:", 5)) {
 			char *p;
 			int i;
drivers/video/radeonfb.c +3 -1
diff -Nur linux-2.4.15-pre4/drivers/video/radeonfb.c linux-2.4.15-pre4-rs/drivers/video/radeonfb.c
@@ -642,7 +642,9 @@
         if (!options || !*options)
                 return 0;
  
-	while (this_opt = strsep (&options, ",")) {
+	while ((this_opt = strsep (&options, ",")) != NULL) {
+		if (!*this_opt)
+			continue;
                 if (!strncmp (this_opt, "font:", 5)) {
                         char *p;
                         int i;
drivers/video/retz3fb.c +3 -1
diff -Nur linux-2.4.15-pre4/drivers/video/retz3fb.c linux-2.4.15-pre4-rs/drivers/video/retz3fb.c
@@ -1348,7 +1348,9 @@
 	if (!options || !*options)
 		return 0;
 
-	while (this_opt = strsep(&options, ",")) {
+	while ((this_opt = strsep(&options, ",")) != NULL) {
+		if (!*this_opt)
+			continue;
 		if (!strcmp(this_opt, "inverse")) {
 			z3fb_inverse = 1;
 			fb_invert_cmaps();
drivers/video/riva/fbdev.c +3 -1
diff -Nur linux-2.4.15-pre4/drivers/video/riva/fbdev.c linux-2.4.15-pre4-rs/drivers/video/riva/fbdev.c
@@ -2045,7 +2045,9 @@
 	if (!options || !*options)
 		return 0;
 
-	while (this_opt = strsep(&options, ",")) {
+	while ((this_opt = strsep(&options, ",")) != NULL) {
+		if (!*this_opt)
+			continue;
 		if (!strncmp(this_opt, "font:", 5)) {
 			char *p;
 			int i;
drivers/video/sa1100fb.c +1 -1
diff -Nur linux-2.4.15-pre4/drivers/video/sa1100fb.c linux-2.4.15-pre4-rs/drivers/video/sa1100fb.c
@@ -2369,7 +2369,7 @@
 	if (!options || !*options)
 		return 0;
 
-	while (this_opt = strsep(&options, ",")) {
+	while ((this_opt = strsep(&options, ",")) != NULL) {
 
 		if (!strncmp(this_opt, "bpp:", 4))
 			current_par.max_bpp =
drivers/video/sgivwfb.c +1 -1
diff -Nur linux-2.4.15-pre4/drivers/video/sgivwfb.c linux-2.4.15-pre4-rs/drivers/video/sgivwfb.c
@@ -863,7 +863,7 @@
   if (!options || !*options)
     return 0;
 
-  while (this_opt = strsep(&options, ",")) {
+  while ((this_opt = strsep(&options, ",")) != NULL) {
     if (!strncmp(this_opt, "font:", 5))
       strcpy(fb_info.fontname, this_opt+5);
   }
drivers/video/sstfb.c +1 -1
diff -Nur linux-2.4.15-pre4/drivers/video/sstfb.c linux-2.4.15-pre4-rs/drivers/video/sstfb.c
@@ -1697,7 +1697,7 @@
 	if (!options || !*options)
 		return 0;
 
-	while (this_opt = strsep(&options, ",")) {
+	while ((this_opt = strsep(&options, ",")) != NULL) {
 		if (!*this_opt) continue;
 
 		f_ddprintk("option %s\n", this_opt);
drivers/video/tdfxfb.c +3 -1
diff -Nur linux-2.4.15-pre4/drivers/video/tdfxfb.c linux-2.4.15-pre4-rs/drivers/video/tdfxfb.c
@@ -2086,7 +2086,9 @@
   if(!options || !*options)
     return;
 
-  while(this_opt = strsep(&options, ",")) {
+  while((this_opt = strsep(&options, ",")) != NULL) {
+    if(!*this_opt)
+      continue;
     if(!strcmp(this_opt, "inverse")) {
       inverse = 1;
       fb_invert_cmaps();
drivers/video/tgafb.c +1 -1
diff -Nur linux-2.4.15-pre4/drivers/video/tgafb.c linux-2.4.15-pre4-rs/drivers/video/tgafb.c
@@ -889,7 +889,7 @@
     int i;
     
     if (options && *options) {
-    	while (this_opt = strsep(&options, ",")) {
+    	while ((this_opt = strsep(&options, ",")) != NULL) {
        	    if (!*this_opt) { continue; }
         
 	    if (!strncmp(this_opt, "font:", 5)) {
drivers/video/valkyriefb.c +1 -1
diff -Nur linux-2.4.15-pre4/drivers/video/valkyriefb.c linux-2.4.15-pre4-rs/drivers/video/valkyriefb.c
@@ -801,7 +801,7 @@
 	if (!options || !*options)
 		return 0;
 
-	while (this_opt = strsep(&options, ",")) {
+	while ((this_opt = strsep(&options, ",")) != NULL) {
 		if (!strncmp(this_opt, "font:", 5)) {
 			char *p;
 			int i;
drivers/video/vesafb.c +1 -1
diff -Nur linux-2.4.15-pre4/drivers/video/vesafb.c linux-2.4.15-pre4-rs/drivers/video/vesafb.c
@@ -457,7 +457,7 @@
 	if (!options || !*options)
 		return 0;
 	
-	while (this_opt = strsep(&options, ",")) {
+	while ((this_opt = strsep(&options, ",")) != NULL) {
 		if (!*this_opt) continue;
 		
 		if (! strcmp(this_opt, "inverse"))
drivers/video/vfb.c +1 -1
diff -Nur linux-2.4.15-pre4/drivers/video/vfb.c linux-2.4.15-pre4-rs/drivers/video/vfb.c
@@ -382,7 +382,7 @@
     if (!options || !*options)
 	return 0;
 
-    while (this_opt = strsep(&options, ",")) {
+    while ((this_opt = strsep(&options, ",")) != NULL) {
 	if (!strncmp(this_opt, "font:", 5))
 	    strcpy(fb_info.fontname, this_opt+5);
     }
drivers/video/vga16fb.c +1 -1
diff -Nur linux-2.4.15-pre4/drivers/video/vga16fb.c linux-2.4.15-pre4-rs/drivers/video/vga16fb.c
@@ -692,7 +692,7 @@
 	if (!options || !*options)
 		return 0;
 	
-	while (this_opt = strsep(&options, ",")) {
+	while ((this_opt = strsep(&options, ",")) != NULL) {
 		if (!*this_opt) continue;
 		
 		if (!strncmp(this_opt, "font:", 5))
drivers/video/virgefb.c +3 -1
diff -Nur linux-2.4.15-pre4/drivers/video/virgefb.c linux-2.4.15-pre4-rs/drivers/video/virgefb.c
@@ -1085,7 +1085,9 @@
 	if (!options || !*options)
 		return 0;
 
-	while (this_opt = strsep(&options, ",")) {
+	while ((this_opt = strsep(&options, ",")) != NULL) {
+		if (!*this_opt)
+			continue;
 		if (!strcmp(this_opt, "inverse")) {
 			Cyberfb_inverse = 1;
 			fb_invert_cmaps();