summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Kacur <jkacur@redhat.com>2010-01-27 19:47:03 +0100
committerJohn Kacur <jkacur@redhat.com>2010-01-27 19:47:03 +0100
commit522560b82f0b6e138d9fd7fcecc2d90d1b8fbf5f (patch)
tree538b8b5d20ccb518d198df722eafb1fcaef7981f
parent51dfab754a398581b19dd98ed26be9e7f0d28ddd (diff)
downloadrt-tests-522560b82f0b6e138d9fd7fcecc2d90d1b8fbf5f.tar.gz
rt-tests: Remove the ret variable, the end label and the goto.
Remove the ret variable, the end lable and the goto. We already have inconsistent exit points for the function, and the end lable wasn't strictly for errors. Directly returning simplifies and shortens the code. Signed-off-by: John Kacur <jkacur@redhat.com>
-rw-r--r--src/cyclictest/rt_numa.h14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/cyclictest/rt_numa.h b/src/cyclictest/rt_numa.h
index 8d44097..ac2aca2 100644
--- a/src/cyclictest/rt_numa.h
+++ b/src/cyclictest/rt_numa.h
@@ -73,7 +73,7 @@ static int rt_numa_numa_node_of_cpu(int cpu)
static int rt_numa_numa_node_of_cpu(int cpu)
{
unsigned char cpumask[16];
- int node, ret, idx, bit;
+ int node, idx, bit;
int max_node, max_cpus;
max_node = numa_max_node();
@@ -88,19 +88,15 @@ static int rt_numa_numa_node_of_cpu(int cpu)
idx = cpu / 8;
bit = cpu % 8;
- for (node = 0; node <= max_node; node++){
+ for (node = 0; node <= max_node; node++) {
if (numa_node_to_cpus(node, (void *) cpumask, sizeof(cpumask)))
return -1;
- if (cpumask[idx] & (1<<bit)) {
- ret = node;
- goto end;
- }
+ if (cpumask[idx] & (1<<bit))
+ return node;
}
- ret = -1;
errno = EINVAL;
-end:
- return ret;
+ return -1;
}
#endif /* LIBNUMA_API_VERSION */