compiling clk-main.c results in: warning: passing argument 1 of 'memcpy' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] memcpy(clkmain->clk.parent_names, parent_names, parents_array_size); ~~~~~~~~~~~~^~~~~~~~~~~~~ Avoid this by replacing the xzalloc+memcpy pair with xmemdup. Zero-initialization of the buffer isn't necessary, because memcpy spans the whole buffer. Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx> --- drivers/clk/at91/clk-main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/clk/at91/clk-main.c b/drivers/clk/at91/clk-main.c index 4d4127dd0016..abae35566c2f 100644 --- a/drivers/clk/at91/clk-main.c +++ b/drivers/clk/at91/clk-main.c @@ -455,8 +455,7 @@ at91_clk_register_sam9x5_main(struct regmap *regmap, clkmain->clk.name = name; clkmain->clk.ops = &sam9x5_main_ops; parents_array_size = num_parents * sizeof (clkmain->clk.parent_names[0]); - clkmain->clk.parent_names = xzalloc(parents_array_size); - memcpy(clkmain->clk.parent_names, parent_names, parents_array_size); + clkmain->clk.parent_names = xmemdup(parent_names, parents_array_size); clkmain->clk.num_parents = num_parents; /* init.flags = CLK_SET_PARENT_GATE; */ -- 2.20.1 _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox