From patchwork Wed Mar 27 10:22:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 15689 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 5400623E66 for ; Wed, 27 Mar 2013 10:22:19 +0000 (UTC) Received: from mail-vb0-f49.google.com (mail-vb0-f49.google.com [209.85.212.49]) by fiordland.canonical.com (Postfix) with ESMTP id EDA52A18178 for ; Wed, 27 Mar 2013 10:22:18 +0000 (UTC) Received: by mail-vb0-f49.google.com with SMTP id s24so5094115vbi.36 for ; Wed, 27 Mar 2013 03:22:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=mfw0uVH4DoF+OGZkmhVfAVCzzIO1cU2kyqK/yR6k1LU=; b=mFSAwgJC6YH502Hyzc5pVhumh6FxGtf+Wzzm/GqMWrlSpIN7FtqN3gR47XR/SF8d0S 1O5blG23sdL4NmCmlw2jN+uPHN3XT7blnowVkH4GFhYF2j2wAzIqg4GJg2F3cMMAbfi1 LztygFeCSvyQmzLGIhy8OeuUfWSCl5e3FKLCkope+sxM0vkHPsLMZNQ4qqOx03ZuQFU/ PZI6X7VCpD3tztUnPhv+1BwJlyidh0TEE121ZZqxGYvfwj8iIlJv7yqwGqVlJeGvCh7U Fj4z9/JtYN4RopEbXzdcmdyepXP9mGKtkrMBnMC49UFQgJBdh4XA3B/optfeSd3k0ddr 3xvQ== X-Received: by 10.58.29.101 with SMTP id j5mr22724607veh.26.1364379738457; Wed, 27 Mar 2013 03:22:18 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.59.4.204 with SMTP id cg12csp109284ved; Wed, 27 Mar 2013 03:22:18 -0700 (PDT) X-Received: by 10.180.13.197 with SMTP id j5mr8661447wic.21.1364379737486; Wed, 27 Mar 2013 03:22:17 -0700 (PDT) Received: from mail-we0-x230.google.com ([2a00:1450:400c:c03::230]) by mx.google.com with ESMTPS id l8si2238818wia.73.2013.03.27.03.22.17 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 27 Mar 2013 03:22:17 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c03::230 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) client-ip=2a00:1450:400c:c03::230; Authentication-Results: mx.google.com; spf=neutral (google.com: 2a00:1450:400c:c03::230 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) smtp.mail=daniel.lezcano@linaro.org Received: by mail-we0-f176.google.com with SMTP id s43so2769425wey.7 for ; Wed, 27 Mar 2013 03:22:17 -0700 (PDT) X-Received: by 10.180.11.148 with SMTP id q20mr8601582wib.18.1364379737045; Wed, 27 Mar 2013 03:22:17 -0700 (PDT) Received: from mai.home (AToulouse-654-1-426-131.w2-6.abo.wanadoo.fr. [2.6.209.131]) by mx.google.com with ESMTPS id dp5sm7754760wib.1.2013.03.27.03.22.14 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 27 Mar 2013 03:22:15 -0700 (PDT) From: Daniel Lezcano To: rjw@sisk.pl Cc: tglx@linutronix.de, linus.walleij@linaro.org, kernel@pengutronix.de, santosh.shilimkar@ti.com, linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, patches@linaro.org Subject: [PATCH 1/5] timer: move enum definition out of ifdef section Date: Wed, 27 Mar 2013 11:22:09 +0100 Message-Id: <1364379733-23725-1-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-Gm-Message-State: ALoCoQl8hcFM7sw28+rWWHzbyDjL3BFw0q3f6ED01ooNYI5uVVAvJjiSBK7wGILW4m4w+AEXJfnY The next patch will setup automatically the broadcast timer for the different cpuidle driver when one idle state stops its timer. This will be part of the generic code. But some ARM boards, like s3c64xx, uses cpuidle but without the CONFIG_GENERIC_CLOCKEVENTS_BUILD set. Hence the cpuidle framework will be compiled with the code supposed to be generic, that is with clockevents_notify and the different enum. Also the function clockevents_notify is a noop macro, this is fine except the usual code is: int cpu = smp_processor_id(); clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ON, &cpu); and that raises a warning for the variable cpu which is not used. Move the clock_event_nofitiers enum definition out of the CONFIG_GENERIC_CLOCKEVENTS_BUILD section to prevent a compilation error when these are used in the code. Change the clockevents_notify macro to a static inline noop function to prevent a compilation warning. Signed-off-by: Daniel Lezcano --- include/linux/clockchips.h | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h index 6634652..f9fd937 100644 --- a/include/linux/clockchips.h +++ b/include/linux/clockchips.h @@ -8,6 +8,20 @@ #ifndef _LINUX_CLOCKCHIPS_H #define _LINUX_CLOCKCHIPS_H +/* Clock event notification values */ +enum clock_event_nofitiers { + CLOCK_EVT_NOTIFY_ADD, + CLOCK_EVT_NOTIFY_BROADCAST_ON, + CLOCK_EVT_NOTIFY_BROADCAST_OFF, + CLOCK_EVT_NOTIFY_BROADCAST_FORCE, + CLOCK_EVT_NOTIFY_BROADCAST_ENTER, + CLOCK_EVT_NOTIFY_BROADCAST_EXIT, + CLOCK_EVT_NOTIFY_SUSPEND, + CLOCK_EVT_NOTIFY_RESUME, + CLOCK_EVT_NOTIFY_CPU_DYING, + CLOCK_EVT_NOTIFY_CPU_DEAD, +}; + #ifdef CONFIG_GENERIC_CLOCKEVENTS_BUILD #include @@ -26,20 +40,6 @@ enum clock_event_mode { CLOCK_EVT_MODE_RESUME, }; -/* Clock event notification values */ -enum clock_event_nofitiers { - CLOCK_EVT_NOTIFY_ADD, - CLOCK_EVT_NOTIFY_BROADCAST_ON, - CLOCK_EVT_NOTIFY_BROADCAST_OFF, - CLOCK_EVT_NOTIFY_BROADCAST_FORCE, - CLOCK_EVT_NOTIFY_BROADCAST_ENTER, - CLOCK_EVT_NOTIFY_BROADCAST_EXIT, - CLOCK_EVT_NOTIFY_SUSPEND, - CLOCK_EVT_NOTIFY_RESUME, - CLOCK_EVT_NOTIFY_CPU_DYING, - CLOCK_EVT_NOTIFY_CPU_DEAD, -}; - /* * Clock event features */ @@ -173,7 +173,7 @@ extern int tick_receive_broadcast(void); #ifdef CONFIG_GENERIC_CLOCKEVENTS extern void clockevents_notify(unsigned long reason, void *arg); #else -# define clockevents_notify(reason, arg) do { } while (0) +static inline void clockevents_notify(unsigned long reason, void *arg) {} #endif #else /* CONFIG_GENERIC_CLOCKEVENTS_BUILD */ @@ -181,7 +181,7 @@ extern void clockevents_notify(unsigned long reason, void *arg); static inline void clockevents_suspend(void) {} static inline void clockevents_resume(void) {} -#define clockevents_notify(reason, arg) do { } while (0) +static inline void clockevents_notify(unsigned long reason, void *arg) {} #endif