Skip to contentSkip to conversation

MIPS: Initialize an atomic_t properly with ATOMIC_INIT(0).

PATCH In review Robert P. J. Day 2 participants 2 messages Feb 27, 2010 – Mar 11, 2010 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MIPS: Initialize an atomic_t properly with ATOMIC_INIT(0).

---

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

arch/mips/kernel/smtc.c +1 -1
index 23499b5..0a5ad2d 100644
@@ -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

========================================================================

#1 lore raw
Quoted 2 lines · Robert P. J. Day

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

Indeed, applied.

Thanks!

Ralf