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

Showing the changes to kernel/module (1 of 1 file). Show all

Unified · Split

kernel/module/main.c+2−2
@@ -787,8 +787,8 @@ SYSCALL_DEFINE2(delete_module, const char __user *, name_user, · 786 unmodified lines
787 async_synchronize_full();787 async_synchronize_full();
788 788
789 /* Store the name and taints of the last unloaded module for diagnostic purposes */789 /* 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));790 strscpy(last_unloaded_module.name, mod->name);
791 strscpy(last_unloaded_module.taints, module_flags(mod, buf, false), sizeof(last_unloaded_module.taints));791 strscpy(last_unloaded_module.taints, module_flags(mod, buf, false));
792 792
793 free_module(mod);793 free_module(mod);
794 /* someone could wait for the module in add_unformed_module() */794 /* 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