From: Mathieu Desnoyers Date: Mon, 1 Nov 2021 18:59:41 +0000 (-0400) Subject: Cleanup: notifier syscalls: Remove useless zero-init of zeroed memory X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=ff888241aa2e1e92d3b864b04df3bba7320fbe46;p=lttng-modules.git Cleanup: notifier syscalls: Remove useless zero-init of zeroed memory Signed-off-by: Mathieu Desnoyers Change-Id: I30f1c97f3d8ca9f6d800c0407f8ef96d3199cf06 --- diff --git a/src/lttng-syscalls.c b/src/lttng-syscalls.c index c68baab7..3133ec71 100644 --- a/src/lttng-syscalls.c +++ b/src/lttng-syscalls.c @@ -812,7 +812,6 @@ int lttng_syscalls_register_event_notifier( { struct lttng_event_notifier_group *group = event_notifier_enabler->group; struct lttng_kernel_syscall_table *syscall_table = &group->syscall_table; - unsigned int i; int ret = 0; wrapper_vmalloc_sync_mappings(); @@ -821,26 +820,12 @@ int lttng_syscalls_register_event_notifier( syscall_table->syscall_dispatch = kzalloc(sizeof(struct hlist_head) * sc_table.len, GFP_KERNEL); if (!syscall_table->syscall_dispatch) return -ENOMEM; - - /* Initialize all list_head */ - for (i = 0; i < sc_table.len; i++) - INIT_HLIST_HEAD(&syscall_table->syscall_dispatch[i]); - - /* Init the unknown syscall notifier list. */ - INIT_HLIST_HEAD(&syscall_table->unknown_syscall_dispatch); } if (!syscall_table->syscall_exit_dispatch) { syscall_table->syscall_exit_dispatch = kzalloc(sizeof(struct hlist_head) * sc_table.len, GFP_KERNEL); if (!syscall_table->syscall_exit_dispatch) return -ENOMEM; - - /* Initialize all list_head */ - for (i = 0; i < sc_table.len; i++) - INIT_HLIST_HEAD(&syscall_table->syscall_exit_dispatch[i]); - - /* Init the unknown exit syscall notifier list. */ - INIT_HLIST_HEAD(&syscall_table->unknown_syscall_exit_dispatch); } #ifdef CONFIG_COMPAT @@ -848,13 +833,6 @@ int lttng_syscalls_register_event_notifier( syscall_table->compat_syscall_dispatch = kzalloc(sizeof(struct hlist_head) * compat_sc_table.len, GFP_KERNEL); if (!syscall_table->compat_syscall_dispatch) return -ENOMEM; - - /* Initialize all list_head */ - for (i = 0; i < compat_sc_table.len; i++) - INIT_HLIST_HEAD(&syscall_table->compat_syscall_dispatch[i]); - - /* Init the unknown syscall notifier list. */ - INIT_HLIST_HEAD(&syscall_table->compat_unknown_syscall_dispatch); } if (!syscall_table->compat_syscall_exit_dispatch) { @@ -863,13 +841,6 @@ int lttng_syscalls_register_event_notifier( GFP_KERNEL); if (!syscall_table->compat_syscall_exit_dispatch) return -ENOMEM; - - /* Initialize all list_head */ - for (i = 0; i < compat_sc_exit_table.len; i++) - INIT_HLIST_HEAD(&syscall_table->compat_syscall_exit_dispatch[i]); - - /* Init the unknown exit syscall notifier list. */ - INIT_HLIST_HEAD(&syscall_table->compat_unknown_syscall_exit_dispatch); } #endif