Commit c19edff6 authored by Wolfram Sang's avatar Wolfram Sang Committed by Stephen Boyd
Browse files

clk: move from strlcpy with unused retval to strscpy

Follow the advice of the below link and prefer 'strscpy' in this
subsystem. Conversion is 1:1 because the return value is not used.
Generated by a coccinelle script.

Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/


Signed-off-by: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20220818210000.6600-1-wsa+renesas@sang-engineering.com


Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
parent 568035b0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -165,7 +165,7 @@ vclkdev_alloc(struct clk_hw *hw, const char *con_id, const char *dev_fmt,

	cla->cl.clk_hw = hw;
	if (con_id) {
		strlcpy(cla->con_id, con_id, sizeof(cla->con_id));
		strscpy(cla->con_id, con_id, sizeof(cla->con_id));
		cla->cl.con_id = cla->con_id;
	}

+1 −1
Original line number Diff line number Diff line
@@ -170,7 +170,7 @@ static struct clk *clk_register_dove_divider(struct device *dev,
		.num_parents = num_parents,
	};

	strlcpy(name, dc->name, sizeof(name));
	strscpy(name, dc->name, sizeof(name));

	dc->hw.init = &init;
	dc->base = base;
+1 −1
Original line number Diff line number Diff line
@@ -349,7 +349,7 @@ static int tegra_bpmp_clk_get_info(struct tegra_bpmp *bpmp, unsigned int id,
	if (err < 0)
		return err;

	strlcpy(info->name, response.name, MRQ_CLK_NAME_MAXLEN);
	strscpy(info->name, response.name, MRQ_CLK_NAME_MAXLEN);
	info->num_parents = response.num_parents;

	for (i = 0; i < info->num_parents; i++)