From patchwork Mon Apr 21 09:55:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 28687 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f198.google.com (mail-ie0-f198.google.com [209.85.223.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 405A32032B for ; Mon, 21 Apr 2014 10:01:31 +0000 (UTC) Received: by mail-ie0-f198.google.com with SMTP id to1sf27001421ieb.5 for ; Mon, 21 Apr 2014 03:01:30 -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=XbDatmiVMMuUEwEhRrwHoG6MaY/FG90xHgjSg/pGvaM=; b=g5H1FFZprG2aBTDfQEf9r4YQ04xbUEdIFbdejw7BAJex6MU7bCahTqeV48lO/4AB5E 2fW6IHVm3E6WJD2bkPigvig8BdZi6e4VCXM0RHaaTBvHO3EgS+VP6FAY9aXqDXqcMgxP HKJB+a8qZwZTszclPCeMVcem63kJ5RPwv5CR528R7Ric9trWqisteypiBUltbL3KM1Q/ 0j9U+cNYrHDDBqP7D9mNRp8p2CvWLLBp30FQ+/AhyTOmIq6SxAUdFWCibh3PLsJdPVS8 q7wAhx6ME0eChA5KkXDY07rwxX4v+WDixp/CRTQvUyj0DtQ7997Vp38AzgN+k88njOJD MiQQ== X-Gm-Message-State: ALoCoQnEbkxbwi1Zh/pnnp4WdmBz8rnbn8n02OruhLpZRN6Hsi83DcNknCYhrPVb66cwKZ1vVzDI X-Received: by 10.50.79.197 with SMTP id l5mr9996400igx.0.1398074490704; Mon, 21 Apr 2014 03:01:30 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.26.183 with SMTP id 52ls2414785qgv.38.gmail; Mon, 21 Apr 2014 03:01:30 -0700 (PDT) X-Received: by 10.52.15.132 with SMTP id x4mr414457vdc.31.1398074490567; Mon, 21 Apr 2014 03:01:30 -0700 (PDT) Received: from mail-ve0-f182.google.com (mail-ve0-f182.google.com [209.85.128.182]) by mx.google.com with ESMTPS id vg8si6181951veb.201.2014.04.21.03.01.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 21 Apr 2014 03:01:30 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.182 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.182; Received: by mail-ve0-f182.google.com with SMTP id jw12so7766236veb.13 for ; Mon, 21 Apr 2014 03:01:30 -0700 (PDT) X-Received: by 10.221.58.144 with SMTP id wk16mr2025989vcb.23.1398074490492; Mon, 21 Apr 2014 03:01:30 -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 ib8csp280468vcb; Mon, 21 Apr 2014 03:01:30 -0700 (PDT) X-Received: by 10.66.234.10 with SMTP id ua10mr30545911pac.92.1398074489418; Mon, 21 Apr 2014 03:01:29 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g7si20558459pad.486.2014.04.21.03.01.28; Mon, 21 Apr 2014 03:01:28 -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 S1752546AbaDUKBU (ORCPT + 26 others); Mon, 21 Apr 2014 06:01:20 -0400 Received: from mail-we0-f171.google.com ([74.125.82.171]:63799 "EHLO mail-we0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751443AbaDUJ4L (ORCPT ); Mon, 21 Apr 2014 05:56:11 -0400 Received: by mail-we0-f171.google.com with SMTP id t61so3502031wes.2 for ; Mon, 21 Apr 2014 02:56:10 -0700 (PDT) X-Received: by 10.180.228.42 with SMTP id sf10mr13256297wic.33.1398074170419; Mon, 21 Apr 2014 02:56:10 -0700 (PDT) Received: from localhost ([213.122.173.131]) by mx.google.com with ESMTPSA id do2sm15202505wib.18.2014.04.21.02.56.07 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 21 Apr 2014 02:56:09 -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 08/19] tick-oneshot: move tick_is_oneshot_available() to tick-oneshot.c Date: Mon, 21 Apr 2014 15:25:04 +0530 Message-Id: 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.182 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 defined in tick-oneshot.c. Also, as it isn't used outside kernel/time/, move 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 4d45e08..64897d3 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 7089dea..aaf60a9 100644 --- a/kernel/time/tick-oneshot.c +++ b/kernel/time/tick-oneshot.c @@ -102,6 +102,20 @@ int tick_oneshot_mode_active(void) return ret; } +/** + * 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