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]
Message-Id: <1285871653-26944-1-git-send-email-ernesto@ti.com>
Date:	Thu, 30 Sep 2010 13:34:13 -0500
From:	Ernesto Ramos <ernesto@...com>
To:	gregkh@...e.de, linux-omap@...r.kernel.org,
	linux-kernel@...r.kernel.org
Cc:	ameya.palande@...ia.com, felipe.contreras@...il.com,
	andy.shevchenko@...il.com, Ernesto Ramos <ernesto@...com>,
	Omar Ramirez Luna <omar.ramirez@...com>
Subject: [PATCH] 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@...com>
Signed-off-by: Omar Ramirez Luna <omar.ramirez@...com>
---
 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 d8f4eeb..a6ae007 100644
--- a/drivers/staging/tidspbridge/rmgr/nldr.c
+++ b/drivers/staging/tidspbridge/rmgr/nldr.c
@@ -35,7 +35,7 @@
 #include <dspbridge/uuidutil.h>
 
 #include <dspbridge/nldr.h>
-#include <linux/gcd.h>
+#include <linux/lcm.h>
 
 /* Name of section containing dynamic load mem */
 #define DYNMEMSECT  ".dspbridge_mem"
@@ -304,7 +304,6 @@ static void unload_ovly(struct nldr_nodeobject *nldr_node_obj,
 			enum nldr_phase phase);
 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);
 
 /*
  *  ======== nldr_allocate ========
@@ -1637,7 +1636,7 @@ static int remote_alloc(void **ref, u16 mem_sect, u32 size,
 	    (size + nldr_obj->us_dsp_word_size -
 	     1) / nldr_obj->us_dsp_word_size;
 	/* Modify memory 'align' to account for DSP cache line size */
-	align = find_lcm(GEM_CACHE_LINE_SIZE, align);
+	align = lcm(GEM_CACHE_LINE_SIZE, align);
 	dev_dbg(bridge, "%s: memory align to 0x%x\n", __func__, align);
 	if (segmnt_id != -1) {
 		rmm_addr_obj->segid = segmnt_id;
@@ -1880,18 +1879,6 @@ static bool find_in_persistent_lib_array(struct nldr_nodeobject *nldr_node_obj,
 	return false;
 }
 
-/*
- * ================ Find LCM (Least Common Multiplier ===
- */
-static u32 find_lcm(u32 a, u32 b)
-{
-	u32 ret;
-
-	ret = a * b / gcd(a, b);
-
-	return ret;
-}
-
 #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