From patchwork Mon Apr 21 09:55:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 28685 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f70.google.com (mail-oa0-f70.google.com [209.85.219.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DB9DE2032B for ; Mon, 21 Apr 2014 10:00:10 +0000 (UTC) Received: by mail-oa0-f70.google.com with SMTP id m1sf10974205oag.1 for ; Mon, 21 Apr 2014 03:00:10 -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=O9COGigXfr/s39O5dflmSwH3+mGg6XeN7g2N6FxF0ng=; b=k28EuQpSbpCeB7rAXV8i8eW15QnU7D9bpBo4xZ+ZefX0qNeSVYauyffPQbovMEUGO5 dB3VJU6/glHpxK2SgPldqS2Flx/ylMAP5+fhba433WMMxFPKYIXY/bDB4pU6YifpA0xl 9o7+wNz73koBilvuPWny9YBD54dFTUJCK+8VJ2yeeq8MukCbEwAl8lRFZoMcJ4TQkYNz ZDPIg6KS02bPHbBYA2GAVvRyjlM2PtWnie1gg3VIBDl83sJi64X5zCKnkdGs6qBe9IVa RFTG69L+xJX3nQGsfqn4LRKwx7R8t29Te4JQomjq+uOg+nRFek0upjkiVt1aULtP9SWu kjyQ== X-Gm-Message-State: ALoCoQnEzGPDvw6uiI2Plx3yCIR+oHdwcbmrRC0H2RSp2VVou95dqZUizev/ClgNigM/W2zdJlJS X-Received: by 10.182.213.5 with SMTP id no5mr18615956obc.15.1398074410616; Mon, 21 Apr 2014 03:00:10 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.101.4 with SMTP id t4ls1512573qge.1.gmail; Mon, 21 Apr 2014 03:00:10 -0700 (PDT) X-Received: by 10.220.133.197 with SMTP id g5mr2561773vct.20.1398074410486; Mon, 21 Apr 2014 03:00:10 -0700 (PDT) Received: from mail-ve0-f181.google.com (mail-ve0-f181.google.com [209.85.128.181]) by mx.google.com with ESMTPS id p4si6187865vem.138.2014.04.21.03.00.10 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 21 Apr 2014 03:00:10 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.181; Received: by mail-ve0-f181.google.com with SMTP id oy12so7770034veb.12 for ; Mon, 21 Apr 2014 03:00:10 -0700 (PDT) X-Received: by 10.58.207.74 with SMTP id lu10mr33140416vec.15.1398074410406; Mon, 21 Apr 2014 03:00:10 -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 ib8csp280408vcb; Mon, 21 Apr 2014 03:00:10 -0700 (PDT) X-Received: by 10.68.106.130 with SMTP id gu2mr36859729pbb.59.1398074409664; Mon, 21 Apr 2014 03:00:09 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ov9si19245938pbc.428.2014.04.21.03.00.08; Mon, 21 Apr 2014 03:00:08 -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 S1752521AbaDUJ77 (ORCPT + 26 others); Mon, 21 Apr 2014 05:59:59 -0400 Received: from mail-we0-f178.google.com ([74.125.82.178]:35803 "EHLO mail-we0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751468AbaDUJ4X (ORCPT ); Mon, 21 Apr 2014 05:56:23 -0400 Received: by mail-we0-f178.google.com with SMTP id u56so3504749wes.37 for ; Mon, 21 Apr 2014 02:56:22 -0700 (PDT) X-Received: by 10.180.109.69 with SMTP id hq5mr13294576wib.30.1398074182180; Mon, 21 Apr 2014 02:56:22 -0700 (PDT) Received: from localhost ([213.122.173.131]) by mx.google.com with ESMTPSA id hu7sm15218676wib.10.2014.04.21.02.56.18 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 21 Apr 2014 02:56:21 -0700 (PDT) From: Viresh Kumar To: tglx@linutronix.de Cc: linaro-kernel@lists.linaro.org, linaro-networking@linaro.org, linux-kernel@vger.kernel.org, fweisbec@gmail.com, Viresh Kumar Subject: [PATCH V2 10/19] tick-common: call tick_check_percpu() from tick_check_preferred() Date: Mon, 21 Apr 2014 15:25:06 +0530 Message-Id: <37a6c338869c26a16f5fd9d6b33c1aa68ffc2c59.1398072824.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.128.181 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 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 965e9c3..9d3106b 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); } @@ -276,10 +276,6 @@ void tick_check_new_device(struct clock_event_device *newdev) if (!cpumask_test_cpu(cpu, newdev->cpumask)) goto out_bc; - /* cpu local device ? */ - if (!tick_check_percpu(curdev, newdev, cpu)) - goto out_bc; - /* Preference decision */ if (!tick_check_preferred(curdev, newdev)) goto out_bc;