From patchwork Mon Apr 14 16:23:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 28367 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qg0-f72.google.com (mail-qg0-f72.google.com [209.85.192.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E9B302036A for ; Mon, 14 Apr 2014 16:57:19 +0000 (UTC) Received: by mail-qg0-f72.google.com with SMTP id q108sf18512133qgd.11 for ; Mon, 14 Apr 2014 09:57:19 -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=4lBFCHru4BWR3R4XOHXeFMQSOs/YJ8IX42b6ZAfBHBg=; b=OHj+vj6Kd+7CJxIjOMZO+OGHvNZOSkeMV0UKhBMkZNT84Nwox3tiGc1gwKQ5NaxQZs qiVf3EZvVHgVofUqzvouUh812gpWax22DTQpYd+mq0PafKrRQSYpyaj3N9aAdR4++AuS sc+HInOkW6IoDgNzOqBEGQDtVj4JuPOnpywUnbOzoKQas26duzfk62HYOaJBX1PEjkEy 5kfrEh0WS9kqayWdVgaY2cfZwJZI+cExQa3AjWgB9AjQ2Cd02fYi6HCuyRfOa2cUlx76 VdE6G0YDKiEv8BOLWSfi8XyLEb4Q6bKiaEDKWHfDy42svbCZiPm4b1/kNHpxuo1ysDRQ dE9A== X-Gm-Message-State: ALoCoQl7Hp4Lhy1SUmqdiC508k4tgOTur/ou6QhS/44pmRlNX5Y8rVSAW6QcomL0qfNlJRge020f X-Received: by 10.224.95.9 with SMTP id b9mr19755360qan.2.1397494639771; Mon, 14 Apr 2014 09:57:19 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.41.40 with SMTP id y37ls2774214qgy.10.gmail; Mon, 14 Apr 2014 09:57:19 -0700 (PDT) X-Received: by 10.220.147.16 with SMTP id j16mr37628809vcv.14.1397494639467; Mon, 14 Apr 2014 09:57:19 -0700 (PDT) Received: from mail-ve0-f170.google.com (mail-ve0-f170.google.com [209.85.128.170]) by mx.google.com with ESMTPS id vg8si2856089veb.39.2014.04.14.09.57.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 14 Apr 2014 09:57:19 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.170 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.170; Received: by mail-ve0-f170.google.com with SMTP id pa12so7883066veb.15 for ; Mon, 14 Apr 2014 09:57:19 -0700 (PDT) X-Received: by 10.220.59.65 with SMTP id k1mr3798913vch.22.1397494639373; Mon, 14 Apr 2014 09:57:19 -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 ib8csp165096vcb; Mon, 14 Apr 2014 09:57:18 -0700 (PDT) X-Received: by 10.68.254.5 with SMTP id ae5mr44915497pbd.83.1397494638590; Mon, 14 Apr 2014 09:57:18 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id px1si3302969pbb.370.2014.04.14.09.57.17; Mon, 14 Apr 2014 09:57:17 -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 S1755401AbaDNQZH (ORCPT + 26 others); Mon, 14 Apr 2014 12:25:07 -0400 Received: from mail-pd0-f176.google.com ([209.85.192.176]:41049 "EHLO mail-pd0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754839AbaDNQZB (ORCPT ); Mon, 14 Apr 2014 12:25:01 -0400 Received: by mail-pd0-f176.google.com with SMTP id r10so8213437pdi.7 for ; Mon, 14 Apr 2014 09:25:00 -0700 (PDT) X-Received: by 10.68.254.103 with SMTP id ah7mr3096126pbd.159.1397492700493; Mon, 14 Apr 2014 09:25:00 -0700 (PDT) Received: from localhost ([122.167.126.16]) by mx.google.com with ESMTPSA id xk3sm34690250pbb.65.2014.04.14.09.24.57 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 14 Apr 2014 09:24:59 -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 08/38] tick-oneshot: move tick_is_oneshot_available() to tick-oneshot.c Date: Mon, 14 Apr 2014 21:53:30 +0530 Message-Id: <9792e3ff835266ba2c1678867e88ac3606a57cd2.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.128.170 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: , This is tick-oneshot specific routine and hence must be there in this file. Also it isn't used outside of kernel/time/ and so moving its declaration to tick-internal.h. Signed-off-by: Viresh Kumar --- include/linux/tick.h | 1 - kernel/time/tick-common.c | 14 -------------- kernel/time/tick-internal.h | 2 ++ kernel/time/tick-oneshot.c | 14 ++++++++++++++ 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/include/linux/tick.h b/include/linux/tick.h index 98065e5..b8ee6f4 100644 --- a/include/linux/tick.h +++ b/include/linux/tick.h @@ -84,7 +84,6 @@ struct tick_sched { }; extern void __init tick_init(void); -extern int tick_is_oneshot_available(void); DECLARE_PER_CPU(struct tick_device, tick_cpu_device); static inline struct tick_device *tick_get_device(int cpu) diff --git a/kernel/time/tick-common.c b/kernel/time/tick-common.c index b4fdb28..298467e 100644 --- a/kernel/time/tick-common.c +++ b/kernel/time/tick-common.c @@ -53,20 +53,6 @@ int tick_do_timer_cpu __read_mostly = TICK_DO_TIMER_BOOT; /* * Debugging: see timer_list.c */ -/** - * tick_is_oneshot_available - check for a oneshot capable event device - */ -int tick_is_oneshot_available(void) -{ - struct clock_event_device *dev = tick_get_cpu_device()->evtdev; - - if (!dev || !(dev->features & CLOCK_EVT_FEAT_ONESHOT)) - return 0; - if (!(dev->features & CLOCK_EVT_FEAT_C3STOP)) - return 1; - return tick_broadcast_oneshot_available(); -} - /* * Periodic tick */ diff --git a/kernel/time/tick-internal.h b/kernel/time/tick-internal.h index 57c1a76..09f4307 100644 --- a/kernel/time/tick-internal.h +++ b/kernel/time/tick-internal.h @@ -42,6 +42,7 @@ extern void tick_setup_oneshot(struct clock_event_device *newdev, extern int tick_program_event(ktime_t expires, int force); extern void tick_oneshot_notify(void); extern int tick_switch_to_oneshot(void (*handler)(struct clock_event_device *)); +extern int tick_is_oneshot_available(void); extern void tick_resume_oneshot(void); # ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST extern void tick_broadcast_setup_oneshot(struct clock_event_device *bc); @@ -96,6 +97,7 @@ static inline int tick_resume_broadcast_oneshot(struct clock_event_device *bc) return 0; } static inline int tick_broadcast_oneshot_active(void) { return 0; } +static inline int tick_is_oneshot_available(void) { return 0; }; static inline bool tick_broadcast_oneshot_available(void) { return false; } #endif /* !TICK_ONESHOT */ diff --git a/kernel/time/tick-oneshot.c b/kernel/time/tick-oneshot.c index 39492f1..cb158f7 100644 --- a/kernel/time/tick-oneshot.c +++ b/kernel/time/tick-oneshot.c @@ -95,6 +95,20 @@ int tick_oneshot_mode_active(void) return tick_get_cpu_device()->mode == TICKDEV_MODE_ONESHOT; } +/** + * tick_is_oneshot_available - check for a oneshot capable event device + */ +int tick_is_oneshot_available(void) +{ + struct clock_event_device *dev = tick_get_cpu_device()->evtdev; + + if (!dev || !(dev->features & CLOCK_EVT_FEAT_ONESHOT)) + return 0; + if (!(dev->features & CLOCK_EVT_FEAT_C3STOP)) + return 1; + return tick_broadcast_oneshot_available(); +} + #ifdef CONFIG_HIGH_RES_TIMERS /** * tick_init_highres - switch to high resolution mode