From: "tip-bot2 for Thorsten Blum" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Thorsten Blum <thorsten.blum@linux.dev>,
Thomas Gleixner <tglx@linutronix.de>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: timers/core] clocksource: Remove unnecessary strscpy() size argument
Date: Thu, 13 Mar 2025 10:52:18 -0000 [thread overview]
Message-ID: <174186313842.14745.7996578935421128528.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20250311110624.495718-2-thorsten.blum@linux.dev>
The following commit has been merged into the timers/core branch of tip:
Commit-ID: fc661d0a78673f23a3fd78d0bb20900ee64d1839
Gitweb: https://git.kernel.org/tip/fc661d0a78673f23a3fd78d0bb20900ee64d1839
Author: Thorsten Blum <thorsten.blum@linux.dev>
AuthorDate: Tue, 11 Mar 2025 12:06:24 +01:00
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Thu, 13 Mar 2025 11:37:44 +01:00
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
---
kernel/time/clocksource.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index 2a7802e..e0eeacb 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -1510,7 +1510,7 @@ static int __init boot_override_clocksource(char* str)
{
mutex_lock(&clocksource_mutex);
if (str)
- strscpy(override_name, str, sizeof(override_name));
+ strscpy(override_name, str);
mutex_unlock(&clocksource_mutex);
return 1;
}
prev parent reply other threads:[~2025-03-13 10:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-11 11:06 [PATCH] clocksource: Remove unnecessary size argument when calling strscpy() Thorsten Blum
2025-03-13 10:33 ` Thomas Gleixner
2025-03-13 10:52 ` tip-bot2 for Thorsten Blum [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=174186313842.14745.7996578935421128528.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=thorsten.blum@linux.dev \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®