summaryrefslogtreecommitdiffstats
path: root/drivers/edac/edac_pci.c
diff options
context:
space:
mode:
authorBorislav Petkov <bp@suse.de>2016-02-02 11:36:11 +0100
committerBorislav Petkov <bp@suse.de>2016-02-02 11:38:50 +0100
commit06e912d4d4c2624c169997e26b3d7b5746735a14 (patch)
tree4bcc7c6e2eb0ea1bccf6d2bc85bb569e97791578 /drivers/edac/edac_pci.c
parent626a7a4dba2ad672b66b675f961de214f0ad0c74 (diff)
downloadop-kernel-dev-06e912d4d4c2624c169997e26b3d7b5746735a14.zip
op-kernel-dev-06e912d4d4c2624c169997e26b3d7b5746735a14.tar.gz
EDAC: Cleanup/sync workqueue functions
They're both running only when ->edac_check is initialized so remove that check from the workqueue function itself. Synchronize/generalize the ->op_state check between the two. Kill useless comments, while at it. Signed-off-by: Borislav Petkov <bp@suse.de>
Diffstat (limited to 'drivers/edac/edac_pci.c')
-rw-r--r--drivers/edac/edac_pci.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/drivers/edac/edac_pci.c b/drivers/edac/edac_pci.c
index 79945e0..8f2f289 100644
--- a/drivers/edac/edac_pci.c
+++ b/drivers/edac/edac_pci.c
@@ -195,23 +195,23 @@ static void edac_pci_workq_function(struct work_struct *work_req)
mutex_lock(&edac_pci_ctls_mutex);
- if (pci->op_state == OP_RUNNING_POLL) {
- /* we might be in POLL mode, but there may NOT be a poll func
- */
- if ((pci->edac_check != NULL) && edac_pci_get_check_errors())
- pci->edac_check(pci);
-
- /* if we are on a one second period, then use round */
- msec = edac_pci_get_poll_msec();
- if (msec == 1000)
- delay = round_jiffies_relative(msecs_to_jiffies(msec));
- else
- delay = msecs_to_jiffies(msec);
-
- /* Reschedule only if we are in POLL mode */
- edac_queue_work(&pci->work, delay);
+ if (pci->op_state != OP_RUNNING_POLL) {
+ mutex_unlock(&edac_pci_ctls_mutex);
+ return;
}
+ if (edac_pci_get_check_errors())
+ pci->edac_check(pci);
+
+ /* if we are on a one second period, then use round */
+ msec = edac_pci_get_poll_msec();
+ if (msec == 1000)
+ delay = round_jiffies_relative(msecs_to_jiffies(msec));
+ else
+ delay = msecs_to_jiffies(msec);
+
+ edac_queue_work(&pci->work, delay);
+
mutex_unlock(&edac_pci_ctls_mutex);
}
OpenPOWER on IntegriCloud