Module Name:    src
Committed By:   cherry
Date:           Wed Aug 10 20:38:45 UTC 2011

Modified Files:
        src/sys/arch/xen/x86: xen_ipi.c

Log Message:
KNF police (rmind@ :-)


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/xen/x86/xen_ipi.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/xen/x86/xen_ipi.c
diff -u src/sys/arch/xen/x86/xen_ipi.c:1.2 src/sys/arch/xen/x86/xen_ipi.c:1.3
--- src/sys/arch/xen/x86/xen_ipi.c:1.2	Wed Aug 10 11:39:46 2011
+++ src/sys/arch/xen/x86/xen_ipi.c	Wed Aug 10 20:38:45 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: xen_ipi.c,v 1.2 2011/08/10 11:39:46 cherry Exp $ */
+/* $NetBSD: xen_ipi.c,v 1.3 2011/08/10 20:38:45 cherry Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -33,10 +33,10 @@
 
 /* 
  * Based on: x86/ipi.c
- * __KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v 1.2 2011/08/10 11:39:46 cherry Exp $"); 
+ * __KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v 1.3 2011/08/10 20:38:45 cherry Exp $"); 
  */
 
-__KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v 1.2 2011/08/10 11:39:46 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v 1.3 2011/08/10 20:38:45 cherry Exp $");
 
 #include <sys/types.h>
 
@@ -96,14 +96,11 @@
 		ci->ci_ipi_events[bit].ev_count++;
 		if (ipifunc[bit] != NULL) {
 			(*ipifunc[bit])(ci, regs);
-		}
-		else {
+		} else {
 			panic("ipifunc[%d] unsupported!\n", bit);
 			/* NOTREACHED */
 		}
 	}
-
-	return;
 }
 
 /* Must be called once for every cpu that expects to send/recv ipis */
@@ -119,7 +116,8 @@
 	vcpu = ci->ci_cpuid;
 	KASSERT(vcpu < MAX_VIRT_CPUS);
 
-	evtchn = ci->ci_ipi_evtchn = bind_vcpu_to_evtch(vcpu);
+	evtchn = bind_vcpu_to_evtch(vcpu);
+	ci->ci_ipi_evtchn = evtchn;
 
 	KASSERT(evtchn != -1 && evtchn < NR_EVENT_CHANNELS);
 
@@ -130,7 +128,6 @@
 	}
 
 	hypervisor_enable_event(evtchn);
-	return;
 }
 
 /* prefer this to global variable */
@@ -148,8 +145,7 @@
 
 	if (ipimask & ~masks) {
 		return false;
-	}
-	else {
+	} else {
 		return true;
 	}
 
@@ -162,15 +158,14 @@
 
 	KASSERT(ci != NULL || ci != curcpu());
 
-	if (!(ci->ci_flags & CPUF_RUNNING)) {
+	if ((ci->ci_flags & CPUF_RUNNING) != 0) {
 		return ENOENT;
 	}
 
 	evtchn = ci->ci_ipi_evtchn;
-	if (false == valid_ipimask(ipimask)) {
-		panic("xen_send_ipi() called with invalid ipimask\n");
-		/* NOTREACHED */
-	}
+
+	KASSERTMSG(valid_ipimask(ipimask) == true, 
+		("xen_send_ipi() called with invalid ipimask\n"));
 
 	atomic_or_32(&ci->ci_ipis, ipimask);
 	hypervisor_notify_via_evtchn(evtchn);
@@ -184,10 +179,8 @@
 	struct cpu_info *ci, *self = curcpu();
 	CPU_INFO_ITERATOR cii;
 
-	if (false == valid_ipimask(ipimask)) {
-		panic("xen_broadcast_ipi() called with invalid ipimask\n");
-		/* NOTREACHED */
-	}
+	KASSERTMSG(valid_ipimask(ipimask) == true, 
+		("xen_broadcast_ipi() called with invalid ipimask\n"));
 
 	/* 
 	 * XXX-cherry: there's an implicit broadcast sending order
@@ -211,9 +204,6 @@
 			}
 		}
 	}
-
-	return;
-	/* NOTREACHED */
 }
 
 /* MD wrapper for the xcall(9) callback. */
@@ -228,7 +218,6 @@
 		panic("vcpu%" PRIuCPUID "shutdown failed.\n", ci->ci_cpuid);
 	}
 
-	return;
 }
 
 static void
@@ -242,7 +231,6 @@
 #else
 	npxsave_cpu(true);
 #endif /* __x86_64__ */
-	return;
 }
 
 static void
@@ -291,7 +279,6 @@
 	KASSERT(intrf != NULL);
 
 	xc_ipi_handler();
-	return;
 }
 
 void
@@ -304,7 +291,7 @@
 	if (ci) {
 		if (0 != xen_send_ipi(ci, XEN_IPI_XCALL)) {
 			panic("xen_send_ipi(XEN_IPI_XCALL) failed\n");
-		};
+		}
 	} else {
 		xen_broadcast_ipi(XEN_IPI_XCALL);
 	}

Reply via email to