History

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.

Thorsten Blum committed 1 year ago

Commit 085c5e31 parent 6380bf81 file · +2 −2Browse files

Unified · Split

kernel/module/main.c+2−2
@@ -787,8 +787,8 @@ SYSCALL_DEFINE2(delete_module, const char __user *, name_user, · 786 unmodified lines
787787 async_synchronize_full();
788788
789789 /* Store the name and taints of the last unloaded module for diagnostic purposes */
790− strscpy(last_unloaded_module.name, mod->name, sizeof(last_unloaded_module.name));
791− strscpy(last_unloaded_module.taints, module_flags(mod, buf, false), sizeof(last_unloaded_module.taints));
790+ strscpy(last_unloaded_module.name, mod->name);
791+ strscpy(last_unloaded_module.taints, module_flags(mod, buf, false));
792792
793793 free_module(mod);
794794 /* someone could wait for the module in add_unformed_module() */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t