From patchwork Wed Jul 28 14:56:01 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ramos Falcon, Ernesto" X-Patchwork-Id: 114810 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o6SEprEb013720 for ; Wed, 28 Jul 2010 14:51:53 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755098Ab0G1OvY (ORCPT ); Wed, 28 Jul 2010 10:51:24 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:42973 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754862Ab0G1OvX (ORCPT ); Wed, 28 Jul 2010 10:51:23 -0400 Received: from dlep33.itg.ti.com ([157.170.170.112]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id o6SEpGd4005839 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 28 Jul 2010 09:51:16 -0500 Received: from emcc1.sasken-mty.naucm.ext.ti.com (localhost [127.0.0.1]) by dlep33.itg.ti.com (8.13.7/8.13.7) with ESMTP id o6SEpER7014645; Wed, 28 Jul 2010 09:51:15 -0500 (CDT) Received: from localhost.localdomain (x0076199-desktop.sasken-mty.naucm.ext.ti.com [10.87.230.107]) by emcc1.sasken-mty.naucm.ext.ti.com (8.13.8+Sun/8.13.8) with ESMTP id o6SEpB2U025585; Wed, 28 Jul 2010 09:51:12 -0500 (CDT) From: Ernesto Ramos To: gregkh@suse.de Cc: omar.ramirez@ti.com, ohad@wizery.com, ameya.palande@nokia.com, felipe.contreras@nokia.com, fernando.lugo@ti.com, linux-kernel@vger.kernel.org, andy.shevchenko@gmail.com, nm@ti.com, linux-omap@vger.kernel.org, Ernesto Ramos Subject: [PATCH] staging:ti dspbridge: remove find_gcf from nldr.c Date: Wed, 28 Jul 2010 09:56:01 -0500 Message-Id: <1280328961-31409-1-git-send-email-ernesto@ti.com> X-Mailer: git-send-email 1.5.4.5 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 28 Jul 2010 14:51:53 +0000 (UTC) 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 #include +#include /* 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