From patchwork Sun Oct 11 17:21:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 7369291 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5C9799F1D5 for ; Sun, 11 Oct 2015 17:22:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B8C7020685 for ; Sun, 11 Oct 2015 17:21:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DA94120681 for ; Sun, 11 Oct 2015 17:21:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752349AbbJKRVw (ORCPT ); Sun, 11 Oct 2015 13:21:52 -0400 Received: from mail-pa0-f49.google.com ([209.85.220.49]:35189 "EHLO mail-pa0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752326AbbJKRVt (ORCPT ); Sun, 11 Oct 2015 13:21:49 -0400 Received: by pabve7 with SMTP id ve7so74365267pab.2 for ; Sun, 11 Oct 2015 10:21:48 -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:in-reply-to :references:in-reply-to:references; bh=hSws2UbvF46jj2fR7tvqBKTghWTdFJU0aGbewcqMpjM=; b=acGBYf4/vzsWM8PGKc8lVLQyb3UX4UMUcXMTO2/84k0vfI5uheaz6kYy0+pd7ir+xj vUC0A3TC2llRGqNyDPrdxlKwme68N8nU/hQsJDc34LbyGFAmQlr/9eVtaubo6x2kIM0x ygVKzry3K1v/wynjnIKvG7opH2E3WtWJGkfoLrRV5abyVf9KzW1Nh+3p5JjnxpBWn+TT q737bOYpHNqHHKNP8zrQdur/KIE4w9e9JGQwl1jjkF449srjy7GtnE2Uez8P8B8Go5Ur R27d4ft4pX0950697yNrSpCcdrv8q9BzBO2J/Lde8XDu25TH9YcY0jZskD1JBdLwJHw7 yD3w== X-Gm-Message-State: ALoCoQk5sVe0mPCrver7Ke3LuHvS4+0YCzselk7yjy9Evt37CRy9Ij+slHmdlxIHWU81XMZiVedl X-Received: by 10.66.235.194 with SMTP id uo2mr22565825pac.41.1444584108745; Sun, 11 Oct 2015 10:21:48 -0700 (PDT) Received: from localhost ([120.59.64.42]) by smtp.gmail.com with ESMTPSA id xa4sm13743043pac.28.2015.10.11.10.21.45 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 11 Oct 2015 10:21:48 -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 5/5] cpufreq: Drop redundant check for inactive policies Date: Sun, 11 Oct 2015 22:51:14 +0530 Message-Id: <2d6d59c2b0654872a32a9b63874b750e6b808cb5.1444583718.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.4.0 In-Reply-To: References: In-Reply-To: References: 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=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 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 --- 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();