Commit 085c5e37 authored by Thorsten Blum's avatar Thorsten Blum Committed by Petr Pavlu
Browse files

module: Remove unnecessary size argument when calling strscpy()



The size parameter is optional and strscpy() automatically determines
the length of the destination buffer using sizeof() if the argument is
omitted. This makes the explicit sizeof() unnecessary. Remove it to
shorten and simplify the code.

Signed-off-by: default avatarThorsten Blum <thorsten.blum@linux.dev>
Link: https://lore.kernel.org/r/20250308194631.191670-2-thorsten.blum@linux.dev


Signed-off-by: default avatarPetr Pavlu <petr.pavlu@suse.com>
parent 6380bf8f
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -787,8 +787,8 @@ SYSCALL_DEFINE2(delete_module, const char __user *, name_user,
	async_synchronize_full();

	/* Store the name and taints of the last unloaded module for diagnostic purposes */
	strscpy(last_unloaded_module.name, mod->name, sizeof(last_unloaded_module.name));
	strscpy(last_unloaded_module.taints, module_flags(mod, buf, false), sizeof(last_unloaded_module.taints));
	strscpy(last_unloaded_module.name, mod->name);
	strscpy(last_unloaded_module.taints, module_flags(mod, buf, false));

	free_module(mod);
	/* someone could wait for the module in add_unformed_module() */