From patchwork Tue Oct 13 05:27:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 7381411 X-Patchwork-Delegate: rjw@sisk.pl Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 97E2CBEEA4 for ; Tue, 13 Oct 2015 05:27:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C8F9A20982 for ; Tue, 13 Oct 2015 05:27:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E407820977 for ; Tue, 13 Oct 2015 05:27:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751580AbbJMF1c (ORCPT ); Tue, 13 Oct 2015 01:27:32 -0400 Received: from mail-pa0-f46.google.com ([209.85.220.46]:34412 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751539AbbJMF1b (ORCPT ); Tue, 13 Oct 2015 01:27:31 -0400 Received: by padhy16 with SMTP id hy16so9911555pad.1 for ; Mon, 12 Oct 2015 22:27:31 -0700 (PDT) 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=n+9pI9eSF+FdeDNaONP1ukXoKa2E0o+rJTZfa27qh1U=; b=YqnuIP8rVzwVoY9PpQwEmROT5mjs9RwGX+aDYaIk5y29MkT+r2/vDyYFKMB681DVmq ciDxZDaq3c1yuvwRL0bTxs/4my1cHTlcy6bD37L60wpsf+tnvhd/x+PYVo3yBRZZtaDg 0rwYqa0H/fHdw3SSuNlfJGgOE9YK3ri1TRL2hQarNckXtJXOydBPupgE9OMJuSZt95Jr nf+VBK3GwtyZPoFy9kN/lALX5BJE9lyLDDNkyEzwEwVS07Ciut45bn7kKSvRhE1RPpMZ TgDZAJ/pQ2LFQnXhCOBE91OTsJBrZb8ev/bzUwuTxJ7iCwxpGrZWJ/TeNpiSZ7YY98cl tZ8w== X-Gm-Message-State: ALoCoQkN8At+/S5CAtP1a54mlfYPxvRETanuZWGsVuJDA3yOBt4Lq51fLkAevA5Yt8W0No10erhF X-Received: by 10.66.121.225 with SMTP id ln1mr2682637pab.86.1444714051122; Mon, 12 Oct 2015 22:27:31 -0700 (PDT) Received: from localhost ([223.227.239.124]) by smtp.gmail.com with ESMTPSA id kw10sm1265278pbc.25.2015.10.12.22.27.27 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 12 Oct 2015 22:27:30 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, skannan@codeaurora.org, Viresh Kumar , linux-kernel@vger.kernel.org (open list) Subject: [PATCH Resend] cpufreq: Drop redundant check for inactive policies Date: Tue, 13 Oct 2015 10:57:13 +0530 Message-Id: <2d6d59c2b0654872a32a9b63874b750e6b808cb5.1444713966.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.4.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 We just made sure policy->cpu is online and this check will always fail as the policy is active. Drop it. Signed-off-by: Viresh Kumar Acked-by: Saravana Kannan Reviewed-by: Saravana Kannan Acked-by: Saravana Kannan --- Resending as a separate patch. drivers/cpufreq/cpufreq.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 58aabe0f2d2c..4fa2215cc6ec 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -843,18 +843,11 @@ static ssize_t store(struct kobject *kobj, struct attribute *attr, down_write(&policy->rwsem); - /* Updating inactive policies is invalid, so avoid doing that. */ - if (unlikely(policy_is_inactive(policy))) { - ret = -EBUSY; - goto unlock_policy_rwsem; - } - if (fattr->store) ret = fattr->store(policy, buf, count); else ret = -EIO; -unlock_policy_rwsem: up_write(&policy->rwsem); unlock: put_online_cpus();