From patchwork Mon Apr 14 16:23:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 28338 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f199.google.com (mail-pd0-f199.google.com [209.85.192.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AFCC220534 for ; Mon, 14 Apr 2014 16:25:55 +0000 (UTC) Received: by mail-pd0-f199.google.com with SMTP id x10sf28967325pdj.6 for ; Mon, 14 Apr 2014 09:25:54 -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=FHxuqdKvFbqhGcIxK2Dg6o5v2fkggxneZSwEQSF62/E=; b=PShcngAEXPx7W58p0/OQ3fqcnyGVfgPYR7dLVCXp3GrvgpxY8nMa/v0ObqfcbLo3IG SBMcU3Dz/pztUufs272XPGOV6/1PygQb1Y8YuF2Xqel/gKU4+SDfAFrojMGpVypSVhA4 8CMs83mIldL1iE+KpaMyJUbKoanioELHBn1d/+DQMcPpXsXMoNLD2B4MDuXQGc87e1Bb wi7zIdtqmUzjq1Ye/cRLvjCFcV1ZmknIP8YmlIhV/E1UWXC8TDwvEEx1xSdY78nHTROf PClClWOTHoutKX5T5g2Dt56X9cqP3M7yAhJPJzQNO2Z2oQgmNVGh8/xzbiotdQSFqPkU jdeg== X-Gm-Message-State: ALoCoQnsYcWbzPDsWfDnL54f9EuZy4lR1qZNn8JM+jBs4vCe7MSVgZpLOE78QiKH95F/2lnm+EQ9 X-Received: by 10.66.121.136 with SMTP id lk8mr20084066pab.34.1397492754953; Mon, 14 Apr 2014 09:25:54 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.41.212 with SMTP id z78ls2390353qgz.93.gmail; Mon, 14 Apr 2014 09:25:54 -0700 (PDT) X-Received: by 10.220.81.194 with SMTP id y2mr1475716vck.29.1397492754730; Mon, 14 Apr 2014 09:25:54 -0700 (PDT) Received: from mail-vc0-f169.google.com (mail-vc0-f169.google.com [209.85.220.169]) by mx.google.com with ESMTPS id sq9si2830483vdc.53.2014.04.14.09.25.54 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 14 Apr 2014 09:25:54 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.169; Received: by mail-vc0-f169.google.com with SMTP id ik5so8100073vcb.28 for ; Mon, 14 Apr 2014 09:25:54 -0700 (PDT) X-Received: by 10.58.230.103 with SMTP id sx7mr2040882vec.28.1397492754635; Mon, 14 Apr 2014 09:25:54 -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.220.221.72 with SMTP id ib8csp162776vcb; Mon, 14 Apr 2014 09:25:54 -0700 (PDT) X-Received: by 10.67.24.1 with SMTP id ie1mr4042991pad.133.1397492753901; Mon, 14 Apr 2014 09:25:53 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cq4si3357113pbc.184.2014.04.14.09.25.52; Mon, 14 Apr 2014 09:25:52 -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 S1755461AbaDNQZe (ORCPT + 26 others); Mon, 14 Apr 2014 12:25:34 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:62976 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755222AbaDNQZ0 (ORCPT ); Mon, 14 Apr 2014 12:25:26 -0400 Received: by mail-pa0-f45.google.com with SMTP id kl14so8419199pab.4 for ; Mon, 14 Apr 2014 09:25:25 -0700 (PDT) X-Received: by 10.66.141.197 with SMTP id rq5mr45274599pab.64.1397492725726; Mon, 14 Apr 2014 09:25:25 -0700 (PDT) Received: from localhost ([122.167.126.16]) by mx.google.com with ESMTPSA id el14sm82391297pac.31.2014.04.14.09.25.22 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 14 Apr 2014 09:25:25 -0700 (PDT) From: Viresh Kumar To: tglx@linutronix.de Cc: linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, fweisbec@gmail.com, Arvind.Chauhan@arm.com, linaro-networking@linaro.org, Viresh Kumar Subject: [PATCH 12/38] tick-common: call tick_check_percpu() from tick_check_preferred() Date: Mon, 14 Apr 2014 21:53:34 +0530 Message-Id: <3dc98fbdafb209e105b42925770da2884da8237e.1397492345.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e 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=neutral (google.com: 209.85.220.169 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 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: , tick_check_percpu() and tick_check_preferred() are called from two places and in exactly same order. So, would make sense to call tick_check_percpu() from tick_check_preferred() instead, so that their common caller can just call tick_check_preferred(). Signed-off-by: Viresh Kumar --- kernel/time/tick-common.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/kernel/time/tick-common.c b/kernel/time/tick-common.c index 8650026..6868d6a 100644 --- a/kernel/time/tick-common.c +++ b/kernel/time/tick-common.c @@ -233,6 +233,9 @@ static bool tick_check_percpu(struct clock_event_device *curdev, static bool tick_check_preferred(struct clock_event_device *curdev, struct clock_event_device *newdev) { + if (!tick_check_percpu(curdev, newdev, smp_processor_id())) + return false; + /* Prefer oneshot capable device */ if (!(newdev->features & CLOCK_EVT_FEAT_ONESHOT)) { if (curdev && (curdev->features & CLOCK_EVT_FEAT_ONESHOT)) @@ -257,9 +260,6 @@ static bool tick_check_preferred(struct clock_event_device *curdev, bool tick_check_replacement(struct clock_event_device *curdev, struct clock_event_device *newdev) { - if (!tick_check_percpu(curdev, newdev, smp_processor_id())) - return false; - return tick_check_preferred(curdev, newdev); } @@ -273,10 +273,6 @@ void tick_check_new_device(struct clock_event_device *newdev) struct tick_device *td = tick_get_device(cpu); struct clock_event_device *curdev = td->evtdev; - /* cpu local device ? */ - if (!tick_check_percpu(curdev, newdev, cpu)) - goto out_bc; - /* Preference decision */ if (!tick_check_preferred(curdev, newdev)) goto out_bc;