[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-mips
Subject:    [PATCH] MIPS: Initialize an atomic_t properly with ATOMIC_INIT(0).
From:       "Robert P. J. Day" <rpjday () crashcourse ! ca>
Date:       2010-02-27 17:02:51
Message-ID: alpine.LFD.2.00.1002271201230.20373 () localhost
[Download RAW message or body]


Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>

---

  AFAIK, the technically correct way to initialize atomic variables is
with ATOMIC_INIT(n).


diff --git a/arch/mips/kernel/smtc.c b/arch/mips/kernel/smtc.c
index 23499b5..0a5ad2d 100644
--- a/arch/mips/kernel/smtc.c
+++ b/arch/mips/kernel/smtc.c
@@ -181,7 +181,7 @@ static int vpemask[2][8] = {
 	{0, 0, 0, 0, 0, 0, 0, 1}
 };
 int tcnoprog[NR_CPUS];
-static atomic_t idle_hook_initialized = {0};
+static atomic_t idle_hook_initialized = ATOMIC_INIT(0);
 static int clock_hang_reported[NR_CPUS];

 #endif /* CONFIG_SMTC_IDLE_HOOK_DEBUG */

========================================================================
Robert P. J. Day                               Waterloo, Ontario, CANADA

            Linux Consulting, Training and Kernel Pedantry.

Web page:                                          http://crashcourse.ca
Twitter:                                       http://twitter.com/rpjday
========================================================================

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic