From patchwork Mon Aug 3 03:06:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 51838 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by patches.linaro.org (Postfix) with ESMTPS id 39EC8229FD for ; Mon, 3 Aug 2015 03:07:13 +0000 (UTC) Received: by wijp15 with SMTP id p15sf9020849wij.3 for ; Sun, 02 Aug 2015 20:07:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:in-reply-to:references :sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=GfiokbL5awsfx9IBqEtHEX+2aX04LqPeWlDJg4zmWYU=; b=erYF2YzqYh3VqESqM3/c0dLieB9q3YnyE/CV7+85huvryYubQNT95Qoa336BWr/c/E Vt9WVzZAzIZYq25opQy99DSdWXVONBSuTDsXsM9nk8p5idu+hFwE8r0mvc3UPHgTima1 /yH349ZgB+BcaEBYmKr68HAxvUVJ5g0okWF65kjU0q6KJBfCaKEuGkhIKefZEHtTZj+L yTmf9xJzaT9vickFs6bX4euJpQ4V70tEDOnKB63teDNOzz79nV1VyJBACb+w/V2eBXoE vZf02YYCtrfnixWNaIGfH53Id8lCycf8DD9jY3RxLZbaZX2Jewmx7Je12Kihht6w9Ydz RgaQ== X-Gm-Message-State: ALoCoQndIvaw38eYMq3HQ8ba/IOTeynn1ki9iMYj0SkwQYPGj1BuDt1EgMtRqWGifEa34EmX5feB X-Received: by 10.152.6.103 with SMTP id z7mr4853097laz.8.1438571232490; Sun, 02 Aug 2015 20:07:12 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.227 with SMTP id t3ls543351laj.72.gmail; Sun, 02 Aug 2015 20:07:12 -0700 (PDT) X-Received: by 10.152.245.168 with SMTP id xp8mr14592365lac.109.1438571232180; Sun, 02 Aug 2015 20:07:12 -0700 (PDT) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com. [209.85.217.176]) by mx.google.com with ESMTPS id jc6si10812147lac.71.2015.08.02.20.07.12 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 02 Aug 2015 20:07:12 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) client-ip=209.85.217.176; Received: by lbbyj8 with SMTP id yj8so70700505lbb.0 for ; Sun, 02 Aug 2015 20:07:12 -0700 (PDT) X-Received: by 10.152.36.161 with SMTP id r1mr14439361laj.88.1438571231847; Sun, 02 Aug 2015 20:07:11 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.7.198 with SMTP id l6csp1626653lba; Sun, 2 Aug 2015 20:07:10 -0700 (PDT) X-Received: by 10.67.14.163 with SMTP id fh3mr31817264pad.155.1438571227094; Sun, 02 Aug 2015 20:07:07 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id tb2si23989280pab.75.2015.08.02.20.07.05; Sun, 02 Aug 2015 20:07:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752798AbbHCDG5 (ORCPT + 28 others); Sun, 2 Aug 2015 23:06:57 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:34629 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752770AbbHCDGz (ORCPT ); Sun, 2 Aug 2015 23:06:55 -0400 Received: by pawu10 with SMTP id u10so1102662paw.1 for ; Sun, 02 Aug 2015 20:06:55 -0700 (PDT) X-Received: by 10.68.232.234 with SMTP id tr10mr19235348pbc.134.1438571215149; Sun, 02 Aug 2015 20:06:55 -0700 (PDT) Received: from localhost ([122.171.186.190]) by smtp.gmail.com with ESMTPSA id g4sm2575484pdg.0.2015.08.02.20.06.53 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 02 Aug 2015 20:06:54 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, Viresh Kumar , linux-kernel@vger.kernel.org (open list) Subject: [PATCH 5/7] cpufreq: remove redundant 'policy' field from user_policy Date: Mon, 3 Aug 2015 08:36:18 +0530 Message-Id: <376177c9f626d0a32fcc45fb1a66d5806efc5ab5.1438571116.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.4.0 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Its always same as policy->policy, and there is no need to keep another copy of it. Remove it. Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq.c | 10 +--------- include/linux/cpufreq.h | 1 - 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 3033952391fe..a80bd68bbd74 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -671,11 +671,7 @@ static ssize_t store_scaling_governor(struct cpufreq_policy *policy, return -EINVAL; ret = cpufreq_set_policy(policy, &new_policy); - if (ret) - return ret; - - policy->user_policy.policy = policy->policy; - return count; + return ret ? ret : count; } /** @@ -1322,9 +1318,6 @@ static int cpufreq_online(unsigned int cpu) goto out_exit_policy; } - if (new_policy) - policy->user_policy.policy = policy->policy; - up_write(&policy->rwsem); kobject_uevent(&policy->kobj, KOBJ_ADD); @@ -2302,7 +2295,6 @@ int cpufreq_update_policy(unsigned int cpu) memcpy(&new_policy, policy, sizeof(*policy)); new_policy.min = policy->user_policy.min; new_policy.max = policy->user_policy.max; - new_policy.policy = policy->user_policy.policy; /* * BIOS might change freq behind our back diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 752bf8a5c314..54dbbff0a55e 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -54,7 +54,6 @@ struct cpufreq_cpuinfo { struct cpufreq_real_policy { unsigned int min; /* in kHz */ unsigned int max; /* in kHz */ - unsigned int policy; /* see above */ }; struct cpufreq_policy {