From owner-p4-projects@FreeBSD.ORG Tue Jan 16 12:25:37 2007 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A955716A412; Tue, 16 Jan 2007 12:25:37 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 82AA816A407 for ; Tue, 16 Jan 2007 12:25:37 +0000 (UTC) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id 73ECA13C455 for ; Tue, 16 Jan 2007 12:25:37 +0000 (UTC) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id l0GCPbXM005434 for ; Tue, 16 Jan 2007 12:25:37 GMT (envelope-from piso@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id l0GCPbVi005431 for perforce@freebsd.org; Tue, 16 Jan 2007 12:25:37 GMT (envelope-from piso@freebsd.org) Date: Tue, 16 Jan 2007 12:25:37 GMT Message-Id: <200701161225.l0GCPbVi005431@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to piso@freebsd.org using -f From: Paolo Pisati To: Perforce Change Reviews Cc: Subject: PERFORCE change 112986 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jan 2007 12:25:38 -0000 http://perforce.freebsd.org/chv.cgi?CH=112986 Change 112986 by piso@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 (; iiv_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 (; iiv_event != NULL) return (iv->iv_event); }