From patchwork Mon Mar 25 17:55:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 15610 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 A758C23E2C for ; Mon, 25 Mar 2013 17:55:44 +0000 (UTC) Received: from mail-vc0-f170.google.com (mail-vc0-f170.google.com [209.85.220.170]) by fiordland.canonical.com (Postfix) with ESMTP id 51B7FA194BB for ; Mon, 25 Mar 2013 17:55:44 +0000 (UTC) Received: by mail-vc0-f170.google.com with SMTP id lf10so4994732vcb.29 for ; Mon, 25 Mar 2013 10:55:43 -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 :in-reply-to:references:x-gm-message-state; bh=yka4+NkoZ0eM3S1Wo9HPakbRM7xPyK/i/dM5aLcTqEQ=; b=BA93Of+bVMt8/CgS1VfAOcf2QXx3OT+VMeBZVtyhxKsAuD2pSHzeugV+VqTXgHnd81 ogjDYspCq3DN6RsniG6J1ZazqHOqKaEew2cqydwRB3Y6jQKyCG32CdZrLX9sN5s8NcX5 JHyS/kCdXvdJCYR65D/7VviR/zT0hou2z5dlEevZxJEQ2vOCYQ0BvfsbtZ26P1c2DYMJ o2NQcgJbx4lIbdzgxJv+iDGh5PUVktj01SS2Pjdf/ITTsoKz6sqDhBWPFyQKR0XkCQ11 BwtNXfGF1ivH8CLUzRvefMcIo7ZlCMr2R3zXg1OGsfvvXb8SxDlk2KjoEvOCHHCF9gN1 Ynjw== X-Received: by 10.52.93.20 with SMTP id cq20mr14338560vdb.38.1364234143790; Mon, 25 Mar 2013 10:55:43 -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 cg12csp37221ved; Mon, 25 Mar 2013 10:55:43 -0700 (PDT) X-Received: by 10.180.74.131 with SMTP id t3mr18951642wiv.26.1364234142539; Mon, 25 Mar 2013 10:55:42 -0700 (PDT) Received: from mail-we0-x22e.google.com ([2a00:1450:400c:c03::22e]) by mx.google.com with ESMTPS id e9si5361879wja.242.2013.03.25.10.55.42 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 25 Mar 2013 10:55:42 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c03::22e is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) client-ip=2a00:1450:400c:c03::22e; Authentication-Results: mx.google.com; spf=neutral (google.com: 2a00:1450:400c:c03::22e 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-f174.google.com with SMTP id u7so1377968wey.33 for ; Mon, 25 Mar 2013 10:55:42 -0700 (PDT) X-Received: by 10.180.94.133 with SMTP id dc5mr32153464wib.1.1364234141985; Mon, 25 Mar 2013 10:55:41 -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 s2sm23927749wib.4.2013.03.25.10.55.39 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 25 Mar 2013 10:55:41 -0700 (PDT) From: Daniel Lezcano To: rjw@sisk.pl, tglx@linutronix.de Cc: patches@linaro.org, linaro-kernel@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, linux@maxim.org.za, nicolas.ferre@atmel.com, plagnioj@jcrosoft.com, lenb@kernel.org, nsekhar@ti.com, kevin.hilman@linaro.org, horms@verge.net.au, magnus.damm@gmail.com, kernel@pengutronix.de, ben-linux@fluff.org, kgene.kim@samsung.com, rob.herring@calxeda.com, jason@lakedaemon.net, andrew@lunn.ch, linus.walleij@linaro.org, linux@arm.linux.org.uk Subject: [PATCH 01/15] timer: move enum definition out of ifdef section Date: Mon, 25 Mar 2013 18:55:26 +0100 Message-Id: <1364234140-514-2-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1364234140-514-1-git-send-email-daniel.lezcano@linaro.org> References: <1364234140-514-1-git-send-email-daniel.lezcano@linaro.org> X-Gm-Message-State: ALoCoQm6YQYcx9vGdLuqbrFyYaE1NF/vr0TDYmsn144+EMCxvFPllSrKKryNPa7EhkutNj6zu9eK 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, but will fail to compile because the enum is not defined. 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 telling the variable 'cpu' 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 | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h index 6634652..ba661e9 100644 --- a/include/linux/clockchips.h +++ b/include/linux/clockchips.h @@ -8,15 +8,6 @@ #ifndef _LINUX_CLOCKCHIPS_H #define _LINUX_CLOCKCHIPS_H -#ifdef CONFIG_GENERIC_CLOCKEVENTS_BUILD - -#include -#include -#include -#include - -struct clock_event_device; - /* Clock event mode commands */ enum clock_event_mode { CLOCK_EVT_MODE_UNUSED = 0, @@ -40,6 +31,15 @@ enum clock_event_nofitiers { CLOCK_EVT_NOTIFY_CPU_DEAD, }; +#ifdef CONFIG_GENERIC_CLOCKEVENTS_BUILD + +#include +#include +#include +#include + +struct clock_event_device; + /* * 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