From patchwork Sun Dec 7 13:58:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rickard Strandqvist X-Patchwork-Id: 5451941 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 55B78BEEA8 for ; Sun, 7 Dec 2014 13:59:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 771FA20158 for ; Sun, 7 Dec 2014 13:59:24 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 89ADA20154 for ; Sun, 7 Dec 2014 13:59:23 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XxcJr-0004dU-9C; Sun, 07 Dec 2014 13:56:15 +0000 Received: from mail-wi0-f170.google.com ([209.85.212.170]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XxcJm-0004Zx-U6 for linux-arm-kernel@lists.infradead.org; Sun, 07 Dec 2014 13:56:12 +0000 Received: by mail-wi0-f170.google.com with SMTP id bs8so5084374wib.5 for ; Sun, 07 Dec 2014 05:55:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=cKNVhDI3PR+2VCn5Gikejj4tganOROL7aBud8O+k3Os=; b=I/5+s/MRIgeiIg8+Pv0UPXr2ZMFJKSNAdwtKvRBan5pPAqCIwww58Btd5lF4OgBpHz g1AkFz4qcYdwLqqIbdu9piqYDm/G5KXr65jWScHJWJqzQi0q/UUxkschkjVV0cRIxFkU pnAvQwaJ4rtdXFLOTjUwGtMelMXKAIdo5UEJcHWqqNrgcNsXUkvYtuTMVTrlyKYTHKyt F8xkPeP4LF0lSIZk52P0rRO8bBJyGJUCB+i9PkpsP01kMVQOL6ctKOzphl5dBTVoTnXk lJCT8NsbAkTfoIP3gUwKgvd583SHeI94wq/boNoxlbyoRB1Q1STsrgHyGxLBe1mWLvtd 9sVQ== X-Gm-Message-State: ALoCoQlPmQFxwl9gk12DtjGDY8jZMOA/dH1LTnAY5KsOJtqcyhRwdE2pTwX+vvDMhF/RCz2mtBkw X-Received: by 10.194.190.19 with SMTP id gm19mr38328761wjc.51.1417960548102; Sun, 07 Dec 2014 05:55:48 -0800 (PST) Received: from localhost.localdomain (h-246-111.a218.priv.bahnhof.se. [85.24.246.111]) by mx.google.com with ESMTPSA id p1sm52666301wjy.22.2014.12.07.05.55.46 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Dec 2014 05:55:47 -0800 (PST) From: Rickard Strandqvist To: Tony Lindgren , Russell King Subject: [PATCH] arch: arm: mach-omap2: powerdomain.c: Remove some unused functions Date: Sun, 7 Dec 2014 14:58:27 +0100 Message-Id: <1417960707-11569-1-git-send-email-rickard_strandqvist@spectrumdigital.se> X-Mailer: git-send-email 1.7.10.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141207_055611_119468_C6C947E7 X-CRM114-Status: GOOD ( 14.98 ) X-Spam-Score: -0.7 (/) Cc: linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Rickard Strandqvist X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Removes some functions that are not used anywhere: pwrdm_get_voltdm() pwrdm_for_each_clkdm() pwrdm_del_clkdm() This was partially found by using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist Acked-by: Nishanth Menon --- arch/arm/mach-omap2/powerdomain.c | 81 ------------------------------------- arch/arm/mach-omap2/powerdomain.h | 5 --- 2 files changed, 86 deletions(-) diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c index 7fb033e..6bd6025 100644 --- a/arch/arm/mach-omap2/powerdomain.c +++ b/arch/arm/mach-omap2/powerdomain.c @@ -484,87 +484,6 @@ pac_exit: } /** - * pwrdm_del_clkdm - remove a clockdomain from a powerdomain - * @pwrdm: struct powerdomain * to add the clockdomain to - * @clkdm: struct clockdomain * to associate with a powerdomain - * - * Dissociate the clockdomain @clkdm from the powerdomain - * @pwrdm. Returns -EINVAL if presented with invalid pointers; -ENOENT - * if @clkdm was not associated with the powerdomain, or 0 upon - * success. - */ -int pwrdm_del_clkdm(struct powerdomain *pwrdm, struct clockdomain *clkdm) -{ - int ret = -EINVAL; - int i; - - if (!pwrdm || !clkdm) - return -EINVAL; - - pr_debug("powerdomain: %s: dissociating clockdomain %s\n", - pwrdm->name, clkdm->name); - - for (i = 0; i < PWRDM_MAX_CLKDMS; i++) - if (pwrdm->pwrdm_clkdms[i] == clkdm) - break; - - if (i == PWRDM_MAX_CLKDMS) { - pr_debug("powerdomain: %s: clkdm %s not associated?!\n", - pwrdm->name, clkdm->name); - ret = -ENOENT; - goto pdc_exit; - } - - pwrdm->pwrdm_clkdms[i] = NULL; - - ret = 0; - -pdc_exit: - return ret; -} - -/** - * pwrdm_for_each_clkdm - call function on each clkdm in a pwrdm - * @pwrdm: struct powerdomain * to iterate over - * @fn: callback function * - * - * Call the supplied function @fn for each clockdomain in the powerdomain - * @pwrdm. The callback function can return anything but 0 to bail - * out early from the iterator. Returns -EINVAL if presented with - * invalid pointers; or passes along the last return value of the - * callback function, which should be 0 for success or anything else - * to indicate failure. - */ -int pwrdm_for_each_clkdm(struct powerdomain *pwrdm, - int (*fn)(struct powerdomain *pwrdm, - struct clockdomain *clkdm)) -{ - int ret = 0; - int i; - - if (!fn) - return -EINVAL; - - for (i = 0; i < PWRDM_MAX_CLKDMS && !ret; i++) - if (pwrdm->pwrdm_clkdms[i]) - ret = (*fn)(pwrdm, pwrdm->pwrdm_clkdms[i]); - - return ret; -} - -/** - * pwrdm_get_voltdm - return a ptr to the voltdm that this pwrdm resides in - * @pwrdm: struct powerdomain * - * - * Return a pointer to the struct voltageomain that the specified powerdomain - * @pwrdm exists in. - */ -struct voltagedomain *pwrdm_get_voltdm(struct powerdomain *pwrdm) -{ - return pwrdm->voltdm.ptr; -} - -/** * pwrdm_get_mem_bank_count - get number of memory banks in this powerdomain * @pwrdm: struct powerdomain * * diff --git a/arch/arm/mach-omap2/powerdomain.h b/arch/arm/mach-omap2/powerdomain.h index 11bd4dd..28a796c 100644 --- a/arch/arm/mach-omap2/powerdomain.h +++ b/arch/arm/mach-omap2/powerdomain.h @@ -212,11 +212,6 @@ int pwrdm_for_each_nolock(int (*fn)(struct powerdomain *pwrdm, void *user), void *user); int pwrdm_add_clkdm(struct powerdomain *pwrdm, struct clockdomain *clkdm); -int pwrdm_del_clkdm(struct powerdomain *pwrdm, struct clockdomain *clkdm); -int pwrdm_for_each_clkdm(struct powerdomain *pwrdm, - int (*fn)(struct powerdomain *pwrdm, - struct clockdomain *clkdm)); -struct voltagedomain *pwrdm_get_voltdm(struct powerdomain *pwrdm); int pwrdm_get_mem_bank_count(struct powerdomain *pwrdm);