linux-mips
[Top] [All Lists]

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

To: linux-mips@linux-mips.org
Subject: [PATCH] MIPS: Initialize an atomic_t properly with ATOMIC_INIT(0).
From: "Robert P. J. Day" <rpjday@crashcourse.ca>
Date: Sat, 27 Feb 2010 12:02:51 -0500 (EST)
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
User-agent: Alpine 2.00 (LFD 1167 2008-08-23)
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 Thread] Current Thread [Next in Thread>
  • [PATCH] MIPS: Initialize an atomic_t properly with ATOMIC_INIT(0)., Robert P. J. Day <=