lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1264623868-23595-4-git-send-email-jkacur@redhat.com>
Date:	Wed, 27 Jan 2010 21:24:26 +0100
From:	John Kacur <jkacur@...hat.com>
To:	Clark Williams <williams@...hat.com>
Cc:	Thomas Gleixner <tglx@...utronix.de>,
	lkml <linux-kernel@...r.kernel.org>, Ingo Molnar <mingo@...e.hu>,
	Carsten Emde <C.Emde@...dl.org>,
	rt-users <linux-rt-users@...r.kernel.org>,
	John Kacur <jkacur@...hat.com>
Subject: [PATCH 3/5] 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@...hat.com>
---
 src/cyclictest/rt_numa.h |   14 +++++---------
 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 */
-- 
1.6.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ