From patchwork Tue Jul 30 13:36:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 18666 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-gh0-f199.google.com (mail-gh0-f199.google.com [209.85.160.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A3ED7248E6 for ; Tue, 30 Jul 2013 13:38:19 +0000 (UTC) Received: by mail-gh0-f199.google.com with SMTP id g14sf1403471ghb.10 for ; Tue, 30 Jul 2013 06:38:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-beenthere:x-forwarded-to:x-forwarded-for :delivered-to:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=jduYPeAYSvB8KPebHJPjj6s35Wo6FuDfksVksEEDIxw=; b=dA1o++QSTnMaj7xvlHvE9jtJkUZa1G/tNGCMPRkdsj1XcW71DArfaH0+HDkLNUVe0L gV2fDxbssbaOTlwYRIsoWw7Lr8S8Fr9K0LcL72xGo38fVcC2Jibht9xPwuyscDadCbwH 2+qXu5fB3kIk9rEGhQUDit5wypIYLNVM3gD2xUtQIBp8fMkoxueqfsBDHyGG8XuU+AdE ji2yAGeCctopkp0ILNN9Cln7rbtiucukK4jm6ys+xP6tXY1DX7I93yNRIlfbzXeZdQOh mOwvYAYEImImSphwyG7j0EmJXGARFOZH8Hg2dLsQrmo6Y8kLlDsZIxWf5bAwV/OrpQy1 g8sw== X-Received: by 10.236.113.77 with SMTP id z53mr26943697yhg.47.1375191499101; Tue, 30 Jul 2013 06:38:19 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.1.168 with SMTP id 8ls176543qen.8.gmail; Tue, 30 Jul 2013 06:38:18 -0700 (PDT) X-Received: by 10.52.99.164 with SMTP id er4mr168289vdb.87.1375191498951; Tue, 30 Jul 2013 06:38:18 -0700 (PDT) Received: from mail-ve0-f173.google.com (mail-ve0-f173.google.com [209.85.128.173]) by mx.google.com with ESMTPS id 7si6740996vca.23.2013.07.30.06.38.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 30 Jul 2013 06:38:18 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.173; Received: by mail-ve0-f173.google.com with SMTP id jw11so3983761veb.18 for ; Tue, 30 Jul 2013 06:38:18 -0700 (PDT) X-Received: by 10.58.6.210 with SMTP id d18mr26706451vea.96.1375191498873; Tue, 30 Jul 2013 06:38:18 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.221.11.8 with SMTP id pc8csp176721vcb; Tue, 30 Jul 2013 06:38:18 -0700 (PDT) X-Received: by 10.68.171.194 with SMTP id aw2mr73949502pbc.197.1375191497490; Tue, 30 Jul 2013 06:38:17 -0700 (PDT) Received: from mail-pd0-f174.google.com (mail-pd0-f174.google.com [209.85.192.174]) by mx.google.com with ESMTPS id pl17si17428093pab.63.2013.07.30.06.38.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 30 Jul 2013 06:38:17 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.174 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.192.174; Received: by mail-pd0-f174.google.com with SMTP id 3so5670082pdj.5 for ; Tue, 30 Jul 2013 06:38:16 -0700 (PDT) X-Received: by 10.68.201.98 with SMTP id jz2mr73638201pbc.56.1375191496854; Tue, 30 Jul 2013 06:38:16 -0700 (PDT) Received: from localhost ([122.167.104.157]) by mx.google.com with ESMTPSA id bb1sm73304782pbc.10.2013.07.30.06.38.13 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 30 Jul 2013 06:38:16 -0700 (PDT) From: Viresh Kumar To: rjw@sisk.pl Cc: linaro-kernel@lists.linaro.org, patches@linaro.org, cpufreq@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Viresh Kumar Subject: [PATCH 1/2] cpufreq: Remove extra variables Date: Tue, 30 Jul 2013 19:06:33 +0530 Message-Id: <2095cb9de80d87867dbfa42f8433f766891c93ab.1375191318.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e X-Gm-Message-State: ALoCoQmGkb0WbE6mnGHOOFymC6qmwPbzBIGxpTsiqbMXph7I1Nc1ivrsrXZuNc34WvEc6GaavE1C X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , We call cpufreq_cpu_get() in cpufreq_add_dev_symlink() to increase usage refcount of policy and not to get policy for a cpu. So, we don't really need to capture the return value of this routine and call put for it later for failure cases. We can simply use policy passed as an argument to this routine. Moreover debug print is rewritten to make it more clear. Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 170d344..35e1a03 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -813,19 +813,18 @@ static int cpufreq_add_dev_symlink(unsigned int cpu, int ret = 0; for_each_cpu(j, policy->cpus) { - struct cpufreq_policy *managed_policy; struct device *cpu_dev; if (j == cpu) continue; - pr_debug("CPU %u already managed, adding link\n", j); - managed_policy = cpufreq_cpu_get(cpu); + pr_debug("Adding link for CPU: %u\n", j); + cpufreq_cpu_get(cpu); cpu_dev = get_cpu_device(j); ret = sysfs_create_link(&cpu_dev->kobj, &policy->kobj, "cpufreq"); if (ret) { - cpufreq_cpu_put(managed_policy); + cpufreq_cpu_put(policy); return ret; } }