From: Shubh <shubhisroking@gmail.com>
To: Andy Gross <agross@kernel.org>
Cc: Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konrad.dybcio@linaro.org>,
linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
Shubh <shubhisroking@gmail.com>
Subject: [PATCH] soc: qcom: cmd-db: refactor deprecated strncpy
Date: Wed, 4 Oct 2023 10:10:17 +0530 [thread overview]
Message-ID: <20231004044017.37027-1-shubhisroking@gmail.com> (raw)
Prefer `strscpy_pad` to `strncpy`.
Signed-off-by: Shubh <shubhisroking@gmail.com>
---
drivers/soc/qcom/cmd-db.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/soc/qcom/cmd-db.c b/drivers/soc/qcom/cmd-db.c
index 34c40368d..dc42704d7 100644
--- a/drivers/soc/qcom/cmd-db.c
+++ b/drivers/soc/qcom/cmd-db.c
@@ -152,7 +152,7 @@ static int cmd_db_get_header(const char *id, const struct entry_header **eh,
* query string is not necessarily '\0' terminated if it bumps up
* against the max size. That's OK and expected.
*/
- strncpy(query, id, sizeof(query));
+ strscpy_pad(query, id, sizeof(query));
for (i = 0; i < MAX_SLV_ID; i++) {
rsc_hdr = &cmd_db_header->header[i];
--
2.42.0
next reply other threads:[~2023-10-04 4:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-04 4:40 Shubh [this message]
2023-10-04 23:18 ` [PATCH] soc: qcom: cmd-db: refactor deprecated strncpy Bjorn Andersson
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=20231004044017.37027-1-shubhisroking@gmail.com \
--to=shubhisroking@gmail.com \
--cc=agross@kernel.org \
--cc=andersson@kernel.org \
--cc=konrad.dybcio@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.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