From patchwork Thu Sep 30 18:34:13 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: 220852 X-Patchwork-Delegate: omar.ramirez@ti.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o8UISQA7026378 for ; Thu, 30 Sep 2010 18:28:26 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755980Ab0I3S2A (ORCPT ); Thu, 30 Sep 2010 14:28:00 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:52181 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754942Ab0I3S17 (ORCPT ); Thu, 30 Sep 2010 14:27:59 -0400 Received: from dlep35.itg.ti.com ([157.170.170.118]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id o8UIRoue003435 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 30 Sep 2010 13:27:50 -0500 Received: from emcc1.sasken-mty.naucm.ext.ti.com (localhost [127.0.0.1]) by dlep35.itg.ti.com (8.13.7/8.13.7) with ESMTP id o8UIRnnT004289; Thu, 30 Sep 2010 13:27:49 -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 o8UIRnV0007220; Thu, 30 Sep 2010 13:27:49 -0500 (CDT) From: Ernesto Ramos To: gregkh@suse.de, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org Cc: ameya.palande@nokia.com, felipe.contreras@gmail.com, andy.shevchenko@gmail.com, Ernesto Ramos , Omar Ramirez Luna Subject: [PATCH] staging:ti dspbridge: Replace find_lcm with lcm kernel func Date: Thu, 30 Sep 2010 13:34:13 -0500 Message-Id: <1285871653-26944-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 (demeter1.kernel.org [140.211.167.41]); Thu, 30 Sep 2010 18:28:26 +0000 (UTC) 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 #include -#include +#include /* 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