diff mbox series

[RESEND,2/2] rasdaemon: fix the issue that non standard decoder can't work in pthread way

Message ID 1590566553-51565-3-git-send-email-tanxiaofei@huawei.com (mailing list archive)
State New, archived
Headers show
Series support l3tag&l3data decoding and one fix | expand

Commit Message

Xiaofei Tan May 27, 2020, 8:02 a.m. UTC
The non standard decoding functions are registered in app init process
through __attribute__((constructor)), and unregistered in app exit process
through __attribute__((destructor)). We don't need to unregister them
in any other steps. This patch removes these unnecessary unregister calls.

Fixes: 78a21c1e9770 ("rasdaemon: add closure and cleanups for the database")
Signed-off-by: Xiaofei Tan <tanxiaofei@huawei.com>
---
 ras-events.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/ras-events.c b/ras-events.c
index 5635278..e6c89dd 100644
--- a/ras-events.c
+++ b/ras-events.c
@@ -496,10 +496,8 @@  static int read_ras_event_all_cpus(struct pthread_data *pdata,
 	    "Old kernel detected. Stop listening and fall back to pthread way.\n");
 
 cleanup:
-	if (pdata[0].ras->record_events) {
-		unregister_ns_dec_tab();
+	if (pdata[0].ras->record_events)
 		ras_mc_event_closedb(pdata[0].cpu, pdata[0].ras);
-	}
 
 error:
 	kbuffer_free(kbuf);
@@ -598,10 +596,8 @@  static void *handle_ras_events_cpu(void *priv)
 
 	read_ras_event(fd, pdata, kbuf, page);
 
-	if (pdata->ras->record_events) {
-		unregister_ns_dec_tab();
+	if (pdata->ras->record_events)
 		ras_mc_event_closedb(pdata->cpu, pdata->ras);
-	}
 
 	close(fd);
 	kbuffer_free(kbuf);