From patchwork Tue Jul 30 13:36:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 18667 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f72.google.com (mail-yh0-f72.google.com [209.85.213.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id EB4F8248E6 for ; Tue, 30 Jul 2013 13:38:25 +0000 (UTC) Received: by mail-yh0-f72.google.com with SMTP id z20sf7269642yhz.7 for ; Tue, 30 Jul 2013 06:38:25 -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 :in-reply-to:references:in-reply-to:references: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=ZrZoOOZph5rC4ey25O5g48d5ny1g2vYbgXB0PHKI+/c=; b=eBzvSr5oz4CByX7FUk3P113MhI7Fxfzhdv+PDPaYlBx/6ayzeLu4y1lOKoiztA7Mq6 zK7kKHiFQ6LEk+Wwk6Mx0QmqmMI2I9JlZs69NJcLSY/cIc4ETlQBHTnqAkNHHsu1cLmD pNB+eQpdHvbl1231zXNxyCTvvWyElPNKbRVQ76+2ZvDs0p3L5NpUdMyt7l0U/z9RjdOv fYEnrBhugC3aG6GcD8xNAAsq6qURz1G4PYLUdP+1zJEm9pBPqoV7zmfJjNfy/uxJE9JP 3rn4dDoemJI8JSLWYnZSwZl3an7379lpC3guGnL65+0iAyH8TA+41rZc9lGCWfEOJjdF fPHQ== X-Received: by 10.236.127.108 with SMTP id c72mr31033362yhi.16.1375191505758; Tue, 30 Jul 2013 06:38:25 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.99.10 with SMTP id em10ls231227qeb.82.gmail; Tue, 30 Jul 2013 06:38:25 -0700 (PDT) X-Received: by 10.58.97.167 with SMTP id eb7mr27158267veb.45.1375191505648; Tue, 30 Jul 2013 06:38:25 -0700 (PDT) Received: from mail-ve0-f181.google.com (mail-ve0-f181.google.com [209.85.128.181]) by mx.google.com with ESMTPS id to9si18778904vdc.136.2013.07.30.06.38.25 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 30 Jul 2013 06:38:25 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.181 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.181; Received: by mail-ve0-f181.google.com with SMTP id jz10so3921757veb.40 for ; Tue, 30 Jul 2013 06:38:25 -0700 (PDT) X-Received: by 10.52.180.229 with SMTP id dr5mr2671119vdc.20.1375191505552; Tue, 30 Jul 2013 06:38:25 -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 pc8csp176725vcb; Tue, 30 Jul 2013 06:38:25 -0700 (PDT) X-Received: by 10.68.189.8 with SMTP id ge8mr44981524pbc.160.1375191504577; Tue, 30 Jul 2013 06:38:24 -0700 (PDT) Received: from mail-pa0-f46.google.com (mail-pa0-f46.google.com [209.85.220.46]) by mx.google.com with ESMTPS id gg2si3507639pac.14.2013.07.30.06.38.24 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 30 Jul 2013 06:38:24 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.46 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.220.46; Received: by mail-pa0-f46.google.com with SMTP id fa1so7221633pad.33 for ; Tue, 30 Jul 2013 06:38:24 -0700 (PDT) X-Received: by 10.68.189.103 with SMTP id gh7mr10186771pbc.142.1375191503971; Tue, 30 Jul 2013 06:38:23 -0700 (PDT) Received: from localhost ([122.167.104.157]) by mx.google.com with ESMTPSA id eq5sm83171904pbc.15.2013.07.30.06.38.20 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 30 Jul 2013 06:38:23 -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 2/2] cpufreq: don't pass cpu to cpufreq_add_dev_{symlink|interface} Date: Tue, 30 Jul 2013 19:06:34 +0530 Message-Id: X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e In-Reply-To: <2095cb9de80d87867dbfa42f8433f766891c93ab.1375191318.git.viresh.kumar@linaro.org> References: <2095cb9de80d87867dbfa42f8433f766891c93ab.1375191318.git.viresh.kumar@linaro.org> In-Reply-To: <2095cb9de80d87867dbfa42f8433f766891c93ab.1375191318.git.viresh.kumar@linaro.org> References: <2095cb9de80d87867dbfa42f8433f766891c93ab.1375191318.git.viresh.kumar@linaro.org> X-Gm-Message-State: ALoCoQmHEyahkpLVmI9JgrIyUVbnSvguhg7AWhU0YEPOE26fuS5kSkJ4RlfAurXOpIpUp18twXvT X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.181 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: , Pointer to struct cpufreq_policy is already passed to these routines and so we don't need to send policy->cpu to them as well. So, get rid of this extra argument and use policy->cpu everywhere. Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 35e1a03..80c0e20 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -806,8 +806,7 @@ void cpufreq_sysfs_remove_file(const struct attribute *attr) EXPORT_SYMBOL(cpufreq_sysfs_remove_file); /* symlink affected CPUs */ -static int cpufreq_add_dev_symlink(unsigned int cpu, - struct cpufreq_policy *policy) +static int cpufreq_add_dev_symlink(struct cpufreq_policy *policy) { unsigned int j; int ret = 0; @@ -815,11 +814,11 @@ static int cpufreq_add_dev_symlink(unsigned int cpu, for_each_cpu(j, policy->cpus) { struct device *cpu_dev; - if (j == cpu) + if (j == policy->cpu) continue; pr_debug("Adding link for CPU: %u\n", j); - cpufreq_cpu_get(cpu); + cpufreq_cpu_get(policy->cpu); cpu_dev = get_cpu_device(j); ret = sysfs_create_link(&cpu_dev->kobj, &policy->kobj, "cpufreq"); @@ -831,8 +830,7 @@ static int cpufreq_add_dev_symlink(unsigned int cpu, return ret; } -static int cpufreq_add_dev_interface(unsigned int cpu, - struct cpufreq_policy *policy, +static int cpufreq_add_dev_interface(struct cpufreq_policy *policy, struct device *dev) { struct freq_attr **drv_attr; @@ -868,7 +866,7 @@ static int cpufreq_add_dev_interface(unsigned int cpu, goto err_out_kobj_put; } - ret = cpufreq_add_dev_symlink(cpu, policy); + ret = cpufreq_add_dev_symlink(policy); if (ret) goto err_out_kobj_put; @@ -1097,7 +1095,7 @@ static int __cpufreq_add_dev(struct device *dev, struct subsys_interface *sif, write_unlock_irqrestore(&cpufreq_driver_lock, flags); if (!frozen) { - ret = cpufreq_add_dev_interface(cpu, policy, dev); + ret = cpufreq_add_dev_interface(policy, dev); if (ret) goto err_out_unregister; }