aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/edac/edac_mc.c11
-rw-r--r--drivers/edac/edac_stub.c4
2 files changed, 6 insertions, 9 deletions
diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c
index 3474ca9d90a..7c952c68f0d 100644
--- a/drivers/edac/edac_mc.c
+++ b/drivers/edac/edac_mc.c
@@ -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;
}
/*
diff --git a/drivers/edac/edac_stub.c b/drivers/edac/edac_stub.c
index 91a038d2f65..3d259c23150 100644
--- a/drivers/edac/edac_stub.c
+++ b/drivers/edac/edac_stub.c
@@ -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);