From patchwork Wed May 9 14:08:08 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 8497 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 2D0A923E42 for ; Wed, 9 May 2012 14:08:19 +0000 (UTC) Received: from mail-wg0-f48.google.com (mail-wg0-f48.google.com [74.125.82.48]) by fiordland.canonical.com (Postfix) with ESMTP id 1A586A18A28 for ; Wed, 9 May 2012 14:08:19 +0000 (UTC) Received: by wgbdq11 with SMTP id dq11so244498wgb.17 for ; Wed, 09 May 2012 07:08:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=+DIav8PjD5yQV+uvjqfcAyDXl/jnsBXQ8iPaaPOS43Q=; b=L5J0eL5dCiAxiJq1Q0mEVh58lsvRoWSY8EzLWlK1GmTU3RC336cqKDbPF8DyRqSPEo WsTpETbq1XH450TMk37xbIwJeAl0wxwC+tsMHTGYTpr5+Q2ketwOntOzFGqiFD5Mc99P vNMUlAQNU+5UugoHFaYjq2579NIpajnZh6R1sRtyNmRkiAPxg3qtuHc9lw7FoS5MPK9a Xv3Gy5dOQexrFVyvT0wGcTZilDehF51u9OdK+iUdh3TyWlq0nyWCLyuLB5ek4NqaCau5 luRRq+U5xL24X5/IzEPb8QGssW0esfCa1KE+JLOnj1aj0RjA4JlXeAJVvhNfdiG7FC/Y guDw== Received: by 10.42.142.71 with SMTP id r7mr167369icu.7.1336572498525; Wed, 09 May 2012 07:08: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.231.73.147 with SMTP id q19csp18807ibj; Wed, 9 May 2012 07:08:17 -0700 (PDT) Received: by 10.180.107.104 with SMTP id hb8mr704962wib.8.1336572496742; Wed, 09 May 2012 07:08:16 -0700 (PDT) Received: from mail-wg0-f50.google.com (mail-wg0-f50.google.com [74.125.82.50]) by mx.google.com with ESMTPS id g6si3646027wie.28.2012.05.09.07.08.16 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 09 May 2012 07:08:16 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.50 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) client-ip=74.125.82.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.50 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) smtp.mail=daniel.lezcano@linaro.org Received: by wgbds11 with SMTP id ds11so327482wgb.31 for ; Wed, 09 May 2012 07:08:16 -0700 (PDT) Received: by 10.216.145.13 with SMTP id o13mr88794wej.95.1336572495938; Wed, 09 May 2012 07:08:15 -0700 (PDT) Received: from localhost.localdomain (AToulouse-159-1-109-226.w92-134.abo.wanadoo.fr. [92.134.236.226]) by mx.google.com with ESMTPS id gd4sm9940915wib.6.2012.05.09.07.08.14 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 09 May 2012 07:08:15 -0700 (PDT) From: Daniel Lezcano To: ben-linux@fluff.org Cc: linux-arm-kernel@lists.infradead.org, linaro-dev@lists.linaro.org, patches@linaro.org Subject: [PATCH 1/2] ARM: s3c64xx: cpuidle - declare the states with the new api Date: Wed, 9 May 2012 16:08:08 +0200 Message-Id: <1336572489-21457-2-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1336572489-21457-1-git-send-email-daniel.lezcano@linaro.org> References: <1336572489-21457-1-git-send-email-daniel.lezcano@linaro.org> X-Gm-Message-State: ALoCoQm2Wi2VlpAWpOKwq1kc3Wx9MK2eCiqfd9LAZD8kkzMDXVQVMSHJC9qrcqtcUKVvr2sIyK0d The states are now part of the cpuidle_driver structure, so we can declare the states in this structure directly. That saves us an extra variable declaration and a memcpy. Signed-off-by: Daniel Lezcano --- arch/arm/mach-s3c64xx/cpuidle.c | 33 ++++++++++++++------------------- 1 files changed, 14 insertions(+), 19 deletions(-) diff --git a/arch/arm/mach-s3c64xx/cpuidle.c b/arch/arm/mach-s3c64xx/cpuidle.c index 179460f..2750e54 100644 --- a/arch/arm/mach-s3c64xx/cpuidle.c +++ b/arch/arm/mach-s3c64xx/cpuidle.c @@ -51,33 +51,28 @@ static int s3c64xx_enter_idle(struct cpuidle_device *dev, return index; } -static struct cpuidle_state s3c64xx_cpuidle_set[] = { - [0] = { - .enter = s3c64xx_enter_idle, - .exit_latency = 1, - .target_residency = 1, - .flags = CPUIDLE_FLAG_TIME_VALID, - .name = "IDLE", - .desc = "System active, ARM gated", - }, -}; +static DEFINE_PER_CPU(struct cpuidle_device, s3c64xx_cpuidle_device); static struct cpuidle_driver s3c64xx_cpuidle_driver = { - .name = "s3c64xx_cpuidle", - .owner = THIS_MODULE, - .state_count = ARRAY_SIZE(s3c64xx_cpuidle_set), -}; - -static struct cpuidle_device s3c64xx_cpuidle_device = { - .state_count = ARRAY_SIZE(s3c64xx_cpuidle_set), + .name = "s3c64xx_cpuidle", + .owner = THIS_MODULE, + .states = { + { + .enter = s3c64xx_enter_idle, + .exit_latency = 1, + .target_residency = 1, + .flags = CPUIDLE_FLAG_TIME_VALID, + .name = "IDLE", + .desc = "System active, ARM gated", + }, + }, + .state_count = 1, }; static int __init s3c64xx_init_cpuidle(void) { int ret; - memcpy(s3c64xx_cpuidle_driver.states, s3c64xx_cpuidle_set, - sizeof(s3c64xx_cpuidle_set)); cpuidle_register_driver(&s3c64xx_cpuidle_driver); ret = cpuidle_register_device(&s3c64xx_cpuidle_device);