drivers/edac: mod assert_error check
authorDave Jiang <djiang@mvista.com>
Thu, 19 Jul 2007 08:49:54 +0000 (01:49 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Thu, 19 Jul 2007 17:04:54 +0000 (10:04 -0700)
Change error check and clear variable from an atomic to an int

Signed-off-by: Dave Jiang <djiang@mvista.com>
Signed-off-by: Douglas Thompson <dougthompson@xmission.com
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/edac/edac_mc.c
drivers/edac/edac_stub.c
include/linux/edac.h

index 3474ca9d90a45e86e1e5b57c0dee8e68a74f22f1..7c952c68f0d6486ef9bb89ab2930786e76b396ff 100644 (file)
@@ -222,18 +222,15 @@ static struct mem_ctl_info *find_mci_by_dev(struct device *dev)
  */
 static int edac_mc_assert_error_check_and_clear(void)
 {
-       int vreg;
+       int old_state;
 
        if(edac_op_state == EDAC_OPSTATE_POLL)
                return 1;
 
-       vreg = atomic_read(&edac_err_assert);
-       if(vreg) {
-               atomic_set(&edac_err_assert, 0);
-               return 1;
-       }
+       old_state = edac_err_assert;
+       edac_err_assert = 0;
 
-       return 0;
+       return old_state;
 }
 
 /*
index 91a038d2f6525643b9129690ceadf670d0b70707..3d259c231507812023a0f67c5b0b8c76c1b05677 100644 (file)
@@ -20,7 +20,7 @@ EXPORT_SYMBOL(edac_op_state);
 atomic_t edac_handlers = ATOMIC_INIT(0);
 EXPORT_SYMBOL(edac_handlers);
 
-atomic_t edac_err_assert = ATOMIC_INIT(0);
+int edac_err_assert = 0;
 EXPORT_SYMBOL(edac_err_assert);
 
 inline int edac_handler_set(void)
@@ -37,6 +37,6 @@ EXPORT_SYMBOL(edac_handler_set);
  */
 inline void edac_atomic_assert_error(void)
 {
-       atomic_set(&edac_err_assert, 1);
+       edac_err_assert++;
 }
 EXPORT_SYMBOL(edac_atomic_assert_error);
index c8b92d79f884272481b4520318bccc14644f26c8..eab451e69a91a0892fee9fa556b4d3a652bdd056 100644 (file)
@@ -20,8 +20,8 @@
 #define EDAC_OPSTATE_INT       2
 
 extern int edac_op_state;
+extern int edac_err_assert;
 extern atomic_t edac_handlers;
-extern atomic_t edac_err_assert;
 
 extern int edac_handler_set(void);
 extern void edac_atomic_assert_error(void);