All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clk: zynqmp: fix -Wstringop-truncation warnings
@ 2020-12-17  6:26 Li Wang
  0 siblings, 0 replies; only message in thread
From: Li Wang @ 2020-12-17  6:26 UTC (permalink / raw)
  To: mturquette, sboyd; +Cc: linux-clk, linux-arm-kernel, linux-kernel

Replace strncpy() with strscpy(), fixes the following warning:
warning: 'strncpy' specified bound 50 equals destination size
[-Wstringop-truncation]

Signed-off-by: Li Wang <li.wang@windriver.com>
---
 drivers/clk/zynqmp/clkc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/zynqmp/clkc.c b/drivers/clk/zynqmp/clkc.c
index db8d0d7..58a2c6e 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;
 	}
 
-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-12-17  6:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-17  6:26 [PATCH] clk: zynqmp: fix -Wstringop-truncation warnings Li Wang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.