diff options
author | Ernesto Ramos <ernesto@ti.com> | 2010-09-30 14:34:13 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-10-05 11:52:08 -0400 |
commit | d10009211ce12c70f8d9084745cadc413ddec7f2 (patch) | |
tree | aaa521f96604ed5a631156220eaebd818b41efd1 | |
parent | 7d1d628344dcc927c1be7363937059a8d6072042 (diff) |
staging: ti dspbridge: Replace find_lcm with lcm kernel func
Resendig this patch since it was missed in the last merge...
Remove find_lcm within nldr.c and use standard
kernel function lcm().
Signed-off-by: Ernesto Ramos <ernesto@ti.com>
Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/staging/tidspbridge/rmgr/nldr.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/drivers/staging/tidspbridge/rmgr/nldr.c b/drivers/staging/tidspbridge/rmgr/nldr.c index d8f4eebf7422..a6ae007015d0 100644 --- a/drivers/staging/tidspbridge/rmgr/nldr.c +++ b/drivers/staging/tidspbridge/rmgr/nldr.c | |||
@@ -35,7 +35,7 @@ | |||
35 | #include <dspbridge/uuidutil.h> | 35 | #include <dspbridge/uuidutil.h> |
36 | 36 | ||
37 | #include <dspbridge/nldr.h> | 37 | #include <dspbridge/nldr.h> |
38 | #include <linux/gcd.h> | 38 | #include <linux/lcm.h> |
39 | 39 | ||
40 | /* Name of section containing dynamic load mem */ | 40 | /* Name of section containing dynamic load mem */ |
41 | #define DYNMEMSECT ".dspbridge_mem" | 41 | #define DYNMEMSECT ".dspbridge_mem" |
@@ -304,7 +304,6 @@ static void unload_ovly(struct nldr_nodeobject *nldr_node_obj, | |||
304 | enum nldr_phase phase); | 304 | enum nldr_phase phase); |
305 | static bool find_in_persistent_lib_array(struct nldr_nodeobject *nldr_node_obj, | 305 | static bool find_in_persistent_lib_array(struct nldr_nodeobject *nldr_node_obj, |
306 | struct dbll_library_obj *lib); | 306 | struct dbll_library_obj *lib); |
307 | static u32 find_lcm(u32 a, u32 b); | ||
308 | 307 | ||
309 | /* | 308 | /* |
310 | * ======== nldr_allocate ======== | 309 | * ======== nldr_allocate ======== |
@@ -1637,7 +1636,7 @@ static int remote_alloc(void **ref, u16 mem_sect, u32 size, | |||
1637 | (size + nldr_obj->us_dsp_word_size - | 1636 | (size + nldr_obj->us_dsp_word_size - |
1638 | 1) / nldr_obj->us_dsp_word_size; | 1637 | 1) / nldr_obj->us_dsp_word_size; |
1639 | /* Modify memory 'align' to account for DSP cache line size */ | 1638 | /* Modify memory 'align' to account for DSP cache line size */ |
1640 | align = find_lcm(GEM_CACHE_LINE_SIZE, align); | 1639 | align = lcm(GEM_CACHE_LINE_SIZE, align); |
1641 | dev_dbg(bridge, "%s: memory align to 0x%x\n", __func__, align); | 1640 | dev_dbg(bridge, "%s: memory align to 0x%x\n", __func__, align); |
1642 | if (segmnt_id != -1) { | 1641 | if (segmnt_id != -1) { |
1643 | rmm_addr_obj->segid = segmnt_id; | 1642 | rmm_addr_obj->segid = segmnt_id; |
@@ -1880,18 +1879,6 @@ static bool find_in_persistent_lib_array(struct nldr_nodeobject *nldr_node_obj, | |||
1880 | return false; | 1879 | return false; |
1881 | } | 1880 | } |
1882 | 1881 | ||
1883 | /* | ||
1884 | * ================ Find LCM (Least Common Multiplier === | ||
1885 | */ | ||
1886 | static u32 find_lcm(u32 a, u32 b) | ||
1887 | { | ||
1888 | u32 ret; | ||
1889 | |||
1890 | ret = a * b / gcd(a, b); | ||
1891 | |||
1892 | return ret; | ||
1893 | } | ||
1894 | |||
1895 | #ifdef CONFIG_TIDSPBRIDGE_BACKTRACE | 1882 | #ifdef CONFIG_TIDSPBRIDGE_BACKTRACE |
1896 | /** | 1883 | /** |
1897 | * nldr_find_addr() - Find the closest symbol to the given address based on | 1884 | * nldr_find_addr() - Find the closest symbol to the given address based on |