Skip to content

Commit fc661d0

Browse files
tobluxKAGA-KOKO
authored andcommitted
clocksource: Remove unnecessary strscpy() size argument
The size argument of strscpy() is only required when the destination pointer is not a fixed sized array or when the copy needs to be smaller than the size of the fixed sized destination array. For fixed sized destination arrays and full copies, strscpy() automatically determines the length of the destination buffer if the size argument is omitted. This makes the explicit sizeof() unnecessary. Remove it. [ tglx: Massaged change log ] Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/all/20250311110624.495718-2-thorsten.blum@linux.dev
1 parent a52067c commit fc661d0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

kernel/time/clocksource.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1510,7 +1510,7 @@ static int __init boot_override_clocksource(char* str)
15101510
{
15111511
mutex_lock(&clocksource_mutex);
15121512
if (str)
1513-
strscpy(override_name, str, sizeof(override_name));
1513+
strscpy(override_name, str);
15141514
mutex_unlock(&clocksource_mutex);
15151515
return 1;
15161516
}

0 commit comments

Comments
 (0)