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>] [day] [month] [year] [list]
Date:	Wed, 28 Jul 2010 09:56:01 -0500
From:	Ernesto Ramos <ernesto@...com>
To:	gregkh@...e.de
Cc:	omar.ramirez@...com, ohad@...ery.com, ameya.palande@...ia.com,
	felipe.contreras@...ia.com, fernando.lugo@...com,
	linux-kernel@...r.kernel.org, andy.shevchenko@...il.com, nm@...com,
	linux-omap@...r.kernel.org, Ernesto Ramos <ernesto@...com>
Subject: [PATCH] staging:ti dspbridge: remove find_gcf from nldr.c

Remove find_gcf from nldr.c and use kernel function
gcd().

Signed-off-by: Ernesto Ramos <ernesto@...com>
---
 drivers/staging/tidspbridge/rmgr/nldr.c |   20 ++------------------
 1 files changed, 2 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/tidspbridge/rmgr/nldr.c b/drivers/staging/tidspbridge/rmgr/nldr.c
index 23b44cf..f01bddd 100644
--- a/drivers/staging/tidspbridge/rmgr/nldr.c
+++ b/drivers/staging/tidspbridge/rmgr/nldr.c
@@ -35,6 +35,7 @@
 #include <dspbridge/uuidutil.h>
 
 #include <dspbridge/nldr.h>
+#include <linux/gcd.h>
 
 /* Name of section containing dynamic load mem */
 #define DYNMEMSECT  ".dspbridge_mem"
@@ -304,7 +305,6 @@ static void unload_ovly(struct nldr_nodeobject *nldr_node_obj,
 static bool find_in_persistent_lib_array(struct nldr_nodeobject *nldr_node_obj,
 					 struct dbll_library_obj *lib);
 static u32 find_lcm(u32 a, u32 b);
-static u32 find_gcf(u32 a, u32 b);
 
 /*
  *  ======== nldr_allocate ========
@@ -1889,27 +1889,11 @@ static u32 find_lcm(u32 a, u32 b)
 {
 	u32 ret;
 
-	ret = a * b / find_gcf(a, b);
+	ret = a * b / gcd(a, b);
 
 	return ret;
 }
 
-/*
- * ================ Find GCF (Greatest Common Factor ) ===
- */
-static u32 find_gcf(u32 a, u32 b)
-{
-	u32 c;
-
-	/* Get the GCF (Greatest common factor between the numbers,
-	 * using Euclidian Algo */
-	while ((c = (a % b))) {
-		a = b;
-		b = c;
-	}
-	return b;
-}
-
 #ifdef CONFIG_TIDSPBRIDGE_BACKTRACE
 /**
  * nldr_find_addr() - Find the closest symbol to the given address based on
-- 
1.5.4.5

--
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