PERFORCE change 112986 for review

Paolo Pisati piso at FreeBSD.org
Tue Jan 16 12:25:38 UTC 2007


http://perforce.freebsd.org/chv.cgi?CH=112986

Change 112986 by piso at piso_newluxor on 2007/01/16 12:24:37

	Modify the interrupt scanning table function:
		o Get rid of a useless variable.
		o Turn the for(..) loop into a while(...).
		o Spacing and style fixes.

Affected files ...

.. //depot/projects/soc2006/intr_filter/amd64/amd64/intr_machdep.c#22 edit
.. //depot/projects/soc2006/intr_filter/arm/arm/intr.c#19 edit
.. //depot/projects/soc2006/intr_filter/i386/i386/intr_machdep.c#29 edit
.. //depot/projects/soc2006/intr_filter/ia64/ia64/interrupt.c#21 edit
.. //depot/projects/soc2006/intr_filter/powerpc/powerpc/intr_machdep.c#27 edit
.. //depot/projects/soc2006/intr_filter/sparc64/sparc64/intr_machdep.c#21 edit
.. //depot/projects/soc2006/intr_filter/sun4v/sun4v/intr_machdep.c#5 edit

Differences ...

==== //depot/projects/soc2006/intr_filter/amd64/amd64/intr_machdep.c#22 (text+ko) ====

@@ -224,15 +224,14 @@
 
 /* Stray detection MD code */
 static struct intr_event *
-walk_intr_src(void) {
+walk_intr_src(void)
+{
 	struct intsrc *isrc;
 	static int i = 0;
-	int j;
 
-	for (; i < NUM_IO_INTS;) {
-		j = i++;
+	while (i < NUM_IO_INTS) {
 		mtx_lock_spin(&intr_table_lock);
-		isrc = interrupt_sources[j];
+		isrc = interrupt_sources[i++];
 		mtx_unlock_spin(&intr_table_lock);	
 		if (isrc != NULL && isrc->is_event != NULL)
 			return (isrc->is_event);

==== //depot/projects/soc2006/intr_filter/arm/arm/intr.c#19 (text+ko) ====

@@ -110,13 +110,13 @@
 
 /* Stray detection MD code */
 static struct intr_event *
-walk_intrs_events(void) {
+walk_intrs_events(void)
+{
 	struct intr_event *ie;
 	static int i = 0;
 
-	for (; i < NIRQ; ) {
-		int j = i++;
-		ie = intr_events[j];
+	while (i < NIRQ) {
+		ie = intr_events[i++];
 		if (ie != NULL)
 			return (ie);
 	}

==== //depot/projects/soc2006/intr_filter/i386/i386/intr_machdep.c#29 (text+ko) ====

@@ -214,14 +214,13 @@
 
 /* Stray detection MD code */
 static struct intr_event *
-walk_intrs_src(void) {
+walk_intrs_src(void)
+{
 	struct intsrc *isrc;
 	static int i = 0;
-	int j;
 
-	for (; i < NUM_IO_INTS;) {
-		j = i++;
-		isrc = interrupt_sources[j];
+	while (i < NUM_IO_INTS) {
+		isrc = interrupt_sources[i++];
 		if (isrc != NULL && isrc->is_event != NULL)
 			return (isrc->is_event);
 	}

==== //depot/projects/soc2006/intr_filter/ia64/ia64/interrupt.c#21 (text+ko) ====

@@ -358,15 +358,14 @@
 
 /* Stray detection MD code */
 static struct intr_event *
-walk_intr_ia64(void) {
+walk_intr_ia64(void)
+{
 	struct ia64_intr *ia64_i;
 	static int i = 0;
-	int j;
 
-	for (; i < IA64_NUMI;) {
-		j = i++;
+	while (i < IA64_NUMI) {
 		mtx_lock_spin(&ia64_intrs_lock);
-		ia64_i = ia64_intrs[j];
+		ia64_i = ia64_intrs[i++];
 		mtx_unlock_spin(&ia64_intrs_lock);
 		if (ia64_i != NULL && ia64_i->event != NULL)
 			return (ia64_i->event);

==== //depot/projects/soc2006/intr_filter/powerpc/powerpc/intr_machdep.c#27 (text+ko) ====

@@ -283,12 +283,10 @@
 {
 	struct ppc_intr *intr;
 	static int i = 0;
-	int j;
 
-	for (; i < ppc_nintrs; ) {
-		j = i++;
+	while (i < ppc_nintrs) {
 		mtx_lock_spin(&ppc_intrs_lock);
-		intr = ppc_intrs[j];
+		intr = ppc_intrs[i++];
 		mtx_unlock_spin(&ppc_intrs_lock);
 		if (intr != NULL && intr->event != NULL)
 			return (intr->event);

==== //depot/projects/soc2006/intr_filter/sparc64/sparc64/intr_machdep.c#21 (text+ko) ====

@@ -239,14 +239,13 @@
 
 /* Stray detection MD code */
 static struct intr_event *
-walk_intr_sparc64(void) {
+walk_intr_sparc64(void)
+{
 	struct intr_vector *iv;
 	static int i = 0;
-	int j;
 
-	for (; i<IV_MAX;) {
-		j = i++;
-		iv = &intr_vectors[j];
+	while (i < IV_MAX) {
+		iv = &intr_vectors[i++];
 		if (iv != NULL && iv->iv_event != NULL)
 			return (iv->iv_event);
 	}

==== //depot/projects/soc2006/intr_filter/sun4v/sun4v/intr_machdep.c#5 (text+ko) ====

@@ -154,14 +154,13 @@
 
 /* Stray detection MD code */
 static struct intr_event *
-walk_intr_sun4v(void) {
+walk_intr_sun4v(void)
+{
 	struct intr_vector *iv;
 	static int i = 0;
-	int j;
 
-	for (; i<IV_MAX;) {
-		j = i++;
-		iv = &intr_vectors[j];
+	while (i < IV_MAX) {
+		iv = &intr_vectors[i++];
 		if (iv != NULL && iv->iv_event != NULL)
 			return (iv->iv_event);
 	}


More information about the p4-projects mailing list