From patchwork Tue Jan 27 08:36: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: 43829 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 33CF92409D for ; Tue, 27 Jan 2015 08:37:44 +0000 (UTC) Received: by mail-wi0-f200.google.com with SMTP id fb4sf1658472wid.3 for ; Tue, 27 Jan 2015 00:37:43 -0800 (PST) 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=GADhPMyqKvjpoW1mdaezpEkvQIByxAkQ3+Of0NjK/CA=; b=ZacxyUKRXb+1QlZa23cvWXvhxpzNbt0c5iMOM89Z1CF4UfNpAuIYxz2tJEnp3lKdEn 3tsOwn+H3fK9lO1UwYkTnQEyZufrgfpdinZx9QRX33qMc03oB80bBzg5X4PNJHL11px5 2As+GQRpoXasiBBSsA2p6ElFDPF+WlxDkX4FgCG3uyLaCEYMMsStC71YVBOoG12CvSqd O0FRus/AO4612FkMig7Yw4ifGZcYzPFehYOVy0EkXVNrnkQ6uuheHQ5Opmfx5sCX6Q/R U0NNXWMs4cdUcDwnlmcwrnaPDSznHCbnRRS/m/wGkAV8oqqFLyVuV7HJTP5eD5yIekxE bO/Q== X-Gm-Message-State: ALoCoQlGP7GQKhohFvg2+8K7P49a4QNzJz48roHZZ0HVkVF4Dq7zQxxP+9HSdhv0Sue9ZtpSoDwD X-Received: by 10.152.36.168 with SMTP id r8mr35637laj.2.1422347863501; Tue, 27 Jan 2015 00:37:43 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.206.37 with SMTP id ll5ls3519lac.53.gmail; Tue, 27 Jan 2015 00:37:43 -0800 (PST) X-Received: by 10.112.142.201 with SMTP id ry9mr224566lbb.4.1422347863187; Tue, 27 Jan 2015 00:37:43 -0800 (PST) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com. [209.85.217.171]) by mx.google.com with ESMTPS id h4si543855lag.70.2015.01.27.00.37.43 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 27 Jan 2015 00:37:43 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) client-ip=209.85.217.171; Received: by mail-lb0-f171.google.com with SMTP id u14so11801373lbd.2 for ; Tue, 27 Jan 2015 00:37:43 -0800 (PST) X-Received: by 10.112.131.1 with SMTP id oi1mr221532lbb.2.1422347863104; Tue, 27 Jan 2015 00:37:43 -0800 (PST) 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.35.133 with SMTP id h5csp1025604lbj; Tue, 27 Jan 2015 00:37:42 -0800 (PST) X-Received: by 10.68.222.130 with SMTP id qm2mr272595pbc.44.1422347856074; Tue, 27 Jan 2015 00:37:36 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g8si627522pdk.182.2015.01.27.00.37.35; Tue, 27 Jan 2015 00:37:36 -0800 (PST) Received-SPF: none (google.com: linux-pm-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757851AbbA0IhJ (ORCPT + 11 others); Tue, 27 Jan 2015 03:37:09 -0500 Received: from mail-pd0-f180.google.com ([209.85.192.180]:59221 "EHLO mail-pd0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757840AbbA0IhI (ORCPT ); Tue, 27 Jan 2015 03:37:08 -0500 Received: by mail-pd0-f180.google.com with SMTP id ft15so17535171pdb.11 for ; Tue, 27 Jan 2015 00:37:07 -0800 (PST) X-Received: by 10.70.128.231 with SMTP id nr7mr163044pdb.116.1422347827561; Tue, 27 Jan 2015 00:37:07 -0800 (PST) Received: from localhost ([122.178.198.250]) by mx.google.com with ESMTPSA id nj8sm820729pdb.42.2015.01.27.00.37.06 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 27 Jan 2015 00:37:07 -0800 (PST) From: Viresh Kumar To: Rafael Wysocki Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, sboyd@codeaurora.org, prarit@redhat.com, skannan@codeaurora.org, Viresh Kumar Subject: [PATCH 07/18] cpufreq: Drop (now) useless check 'cpu > nr_cpu_ids' Date: Tue, 27 Jan 2015 14:06:13 +0530 Message-Id: <0b79fabc34316fe1e38c9cbe4750bd68ae65b03b.1422346933.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.3.0.rc0.44.ga94655d In-Reply-To: References: In-Reply-To: References: Sender: linux-pm-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-pm@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.171 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: , Earlier we used to find the 'policy' belonging to a cpu with the help of a per-cpu variable. And if 'cpu' passed to cpufreq_cpu_get() is bigger than 'nr_cpu_ids', it would have caused unpredictable issues as the per-cpu variable wouldn't have covered that value of 'cpu'. And so we had this check. We traverse active-policy list to find policy for a cpu now. Even if 'cpu' passed to cpufreq_cpu_get() is an invalid number (i.e. greater than nr_cpu_ids), we will be able to manage it without any unpredictable behavior. And so this check isn't required anymore. Get rid of it. Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 7f947287ba46..d9528046f651 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -172,9 +172,6 @@ struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu) struct cpufreq_policy *policy = NULL; unsigned long flags; - if (cpu >= nr_cpu_ids) - return NULL; - if (!down_read_trylock(&cpufreq_rwsem)) return NULL;