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.
Unified · Split
| @@ -787,8 +787,8 @@ SYSCALL_DEFINE2(delete_module, const char __user *, name_user, · 786 unmodified lines | ||
| 787 | 787 | async_synchronize_full(); |
| 788 | 788 | |
| 789 | 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)); | |
| 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)); | |
| 792 | 792 | |
| 793 | 793 | free_module(mod); |
| 794 | 794 | /* someone could wait for the module in add_unformed_module() */ |