context_switch_latency: Tidy up the code a bit
diff --git a/context_switch_latency.c b/context_switch_latency.c
index 7920ea4..ad6818a 100644
--- a/context_switch_latency.c
+++ b/context_switch_latency.c
@@ -19,7 +19,7 @@
int use_xstate = 0;
int thread_cpu;
-void maybe_use_xstate(void)
+static void maybe_use_xstate(void)
{
if (use_xstate)
asm volatile ("pxor %%xmm0, %%xmm0" : : : "xmm0");
@@ -40,11 +40,10 @@
if (read(to_thread, &buf, 8) != 8)
err(1, "read eventfd");
- int s = state;
- if (s == 2)
+ if (state == 2)
return 0;
- else if (1 || s == 0)
- maybe_use_xstate();
+
+ maybe_use_xstate();
buf = 1;
if (write(from_thread, &buf, 8) != 8)
@@ -52,7 +51,7 @@
}
}
-void bounce()
+static void bounce()
{
uint64_t buf = 1;
if (write(to_thread, &buf, 8) != 8)