summaryrefslogtreecommitdiff
path: root/drivers/clk/zynqmp
diff options
context:
space:
mode:
authorShubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>2022-05-10 12:31:53 +0530
committerStephen Boyd <sboyd@kernel.org>2022-08-22 17:01:05 -0700
commitacc1c732f35bb3a26177e54cd3de27e3524426e4 (patch)
tree5ef9b970a48a678e3f3c794346c83cf202f6eeca /drivers/clk/zynqmp
parentdd80fb2dbf1cd8751efbe4e53e54056f56a9b115 (diff)
clk: zynqmp: Replaced strncpy() with strscpy()
Replaced strncpy() with strscpy() as the clock names are supposed to be NULL terminated. Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com> Link: https://lore.kernel.org/r/20220510070154.29528-2-shubhrajyoti.datta@xilinx.com Acked-by: Michal Simek <michal.simek@amd.com> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'drivers/clk/zynqmp')
-rw-r--r--drivers/clk/zynqmp/clkc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/clk/zynqmp/clkc.c b/drivers/clk/zynqmp/clkc.c
index 2c9da6623b84..543e6e81712f 100644
--- a/drivers/clk/zynqmp/clkc.c
+++ b/drivers/clk/zynqmp/clkc.c
@@ -163,7 +163,7 @@ static int zynqmp_get_clock_name(u32 clk_id, char *clk_name)
ret = zynqmp_is_valid_clock(clk_id);
if (ret == 1) {
- strncpy(clk_name, clock[clk_id].clk_name, MAX_NAME_LEN);
+ strscpy(clk_name, clock[clk_id].clk_name, MAX_NAME_LEN);
return 0;
}
@@ -719,7 +719,7 @@ static void zynqmp_get_clock_info(void)
if (!strcmp(name.name, RESERVED_CLK_NAME))
continue;
- strncpy(clock[i].clk_name, name.name, MAX_NAME_LEN);
+ strscpy(clock[i].clk_name, name.name, MAX_NAME_LEN);
}
/* Get topology of all clock */