* [PATCH] soc: qcom: cmd-db: refactor deprecated strncpy
@ 2023-10-04 4:40 Shubh
2023-10-04 23:18 ` Bjorn Andersson
0 siblings, 1 reply; 2+ messages in thread
From: Shubh @ 2023-10-04 4:40 UTC (permalink / raw)
To: Andy Gross
Cc: Bjorn Andersson, Konrad Dybcio, linux-arm-msm, linux-kernel,
Shubh
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] soc: qcom: cmd-db: refactor deprecated strncpy
2023-10-04 4:40 [PATCH] soc: qcom: cmd-db: refactor deprecated strncpy Shubh
@ 2023-10-04 23:18 ` Bjorn Andersson
0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Andersson @ 2023-10-04 23:18 UTC (permalink / raw)
To: Shubh
Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, linux-arm-msm,
linux-kernel
On Wed, Oct 04, 2023 at 10:10:17AM +0530, Shubh wrote:
> Prefer `strscpy_pad` to `strncpy`.
>
> Signed-off-by: Shubh <shubhisroking@gmail.com>
Please spell out your name on future patches.
> ---
> 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));
Please read the comment above, and please read fe72f9bce137 ("soc: qcom:
cmd-db: replace strscpy_pad() with strncpy()")
Thanks,
Bjorn
>
> for (i = 0; i < MAX_SLV_ID; i++) {
> rsc_hdr = &cmd_db_header->header[i];
> --
> 2.42.0
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-10-04 23:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-04 4:40 [PATCH] soc: qcom: cmd-db: refactor deprecated strncpy Shubh
2023-10-04 23:18 ` Bjorn Andersson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox