Skip to contentSkip to conversation

fix compile warnings in 2.4.15pre9

PATCH In review Rich Baum 3 participants 3 messages Nov 22, 2001 – Nov 23, 2001

Subsystems (6)
Networking Media (V4L/DVB) SCSI ATM +2 more subsystems
lore
Share & tools
lore

Rich Baum

author
#0 lore raw

PATCH 1/1 fix compile warnings in 2.4.15pre9

The following patch fixes some compile warnings in 2..4.15pre9.  The warnings are for using labels at the end of compound statements and for tokens at the end of #undef statements.  Please consider applying this patch.

Thanks,
Rich

diff -urN -X dontdiff linux/drivers/atm/firestream.c linux-rb/drivers/atm/firestream.c

drivers/atm/firestream.c +1 -0
@@ -758,6 +758,7 @@
 			kfree (td);
 			break;
 		default:
+			break;
 			/* Here we get the tx purge inhibit command ... */
 			/* Action, I believe, is "don't do anything". -- REW */
 		}

diff -urN -X dontdiff linux/drivers/media/video/meye.c linux-rb/drivers/media/video/meye.c

drivers/media/video/meye.c +1 -0
@@ -903,6 +903,7 @@
 		mchip_free_frame();
 	}
 out:
+	return;
 }
 
 /****************************************************************************

/
diff -urN -X dontdiff linux/drivers/media/video/zr36067.c linux-rb/drivers/media/video/zr36067.c

drivers/media/video/zr36067.c +1 -0
@@ -1418,6 +1418,7 @@
 		post_office_write(zr, 3, 0, 0);
 		udelay(2);
 	default:
+		break;
 	}
 	return 0;
 }

diff -urN -X dontdiff linux/drivers/scsi/cpqfcTSworker.c linux-rb/drivers/scsi/cpqfcTSworker.c

drivers/scsi/cpqfcTSworker.c +2 -1
@@ -2912,6 +2912,7 @@
   }
 
 Done:  
+  	return;
 }
 
 static void 
@@ -3029,7 +3030,7 @@
 
 
 Done:
-
+	return;
 }
 
 

diff -urN -X dontdiff linux/drivers/scsi/sym53c8xx_2/sym_hipd.c linux-rb/drivers/scsi/sym53c8xx_2/sym_hipd.c

drivers/scsi/sym53c8xx_2/sym_hipd.c +2 -0
@@ -4691,6 +4691,7 @@
 	OUTL_DSP (SCRIPTA_BA (np, clrack));
 	return;
 out_stuck:
+	return;
 }
 
 /*
@@ -5226,6 +5227,7 @@
 
 	return;
 fail:
+	return;
 }
 
 /*

diff -urN -X dontdiff linux/drivers/scsi/sym53c8xx_2/sym_nvram.c linux-rb/drivers/scsi/sym53c8xx_2/sym_nvram.c

drivers/scsi/sym53c8xx_2/sym_nvram.c +4 -4
@@ -505,10 +505,10 @@
 	return retv;
 }
 
-#undef SET_BIT 0
-#undef CLR_BIT 1
-#undef SET_CLK 2
-#undef CLR_CLK 3
+#undef SET_BIT /* 0 */
+#undef CLR_BIT /* 1 */
+#undef SET_CLK /* 2 */
+#undef CLR_CLK /* 3 */
 
 /*
  *  Try reading Symbios NVRAM.
fs/ntfs/fs.c +1 -1
diff -urN -X dontdiff linux/fs/ntfs/fs.c linux-rb/fs/ntfs/fs.c
@@ -852,7 +852,7 @@
 		}
 		break;
 	default:
-		/* Nothing. Just clear the inode and exit. */
+		break;	/* Nothing. Just clear the inode and exit. */
 	}
 	ntfs_clear_inode(&inode->u.ntfs_i);
 unl_out:
net/802/cl2llc.c +2 -0
diff -urN -X dontdiff linux/net/802/cl2llc.c linux-rb/net/802/cl2llc.c
@@ -97,6 +97,7 @@
 					llc_interpret_pseudo_code(lp, REJECT1, skb, NO_FRAME);
 				break;
 			default:
+				break;
 		}
 		if(lp->llc_callbacks)
 		{
@@ -498,6 +499,7 @@
 					lp->f_flag = fr->i_hdr.i_pflag;
 				break;
 			default:
+				break;
 		}
 		pc++;	
 	}
#2 lore raw
Quoted 10 lines · Andreas Dilger

How about something like (not real patches, but you get the idea:

drivers/scsi/sym53c8xx_2/sym_hipd.c +1 -1
@@ -4691,6 +4691,7 @@
 	OUTL_DSP (SCRIPTA_BA (np, clrack));
+out_stuck:
 	return;
-out_stuck:
 }
 

drivers/scsi/sym53c8xx_2/sym_hipd.c line 5230

Quoted 5 lines
drivers/scsi/sym53c8xx_2/sym_hipd.c +1 -1
@@ -5226,6 +5227,7 @@
 
+fail:
 	return;
-fail:
 }

Yes, much better. Besides looking better, gcc _may_ generate different code (I don't know how smart it is in this case) that has these "fall throughs" and that would mean (a) less code and (b) less jumps -- always a win.

Robert Love