staging:ti dspbridge: remove find_gcf from nldr.c
authorErnesto Ramos <ernesto@ti.com>
Wed, 28 Jul 2010 14:56:01 +0000 (09:56 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 28 Jul 2010 15:23:35 +0000 (08:23 -0700)
Remove find_gcf from nldr.c and use kernel function
gcd().

Signed-off-by: Ernesto Ramos <ernesto@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/tidspbridge/rmgr/nldr.c

index 55dfb9825f85bed6f5fc1c03a777f82e6cc1514b..d8f4eebf7422d59e0574c530a0781a7261fa03ad 100644 (file)
@@ -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 ========
@@ -1887,27 +1887,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
This page took 0.025376 seconds and 5 git commands to generate.