Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2409e742 authored by Eric Dumazet's avatar Eric Dumazet Committed by Rusty Russell
Browse files

module: module_unload_init() cleanup



No need to clear mod->refptr in module_unload_init(), since
alloc_percpu() already clears allocated chunks.

Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (removed unused var)
parent 3cfc2c42
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -526,14 +526,8 @@ EXPORT_TRACEPOINT_SYMBOL(module_get);
/* Init the unload section of the module. */
static void module_unload_init(struct module *mod)
{
	int cpu;

	INIT_LIST_HEAD(&mod->source_list);
	INIT_LIST_HEAD(&mod->target_list);
	for_each_possible_cpu(cpu) {
		per_cpu_ptr(mod->refptr, cpu)->incs = 0;
		per_cpu_ptr(mod->refptr, cpu)->decs = 0;
	}

	/* Hold reference count during initialization. */
	__this_cpu_write(mod->refptr->incs, 1);