提交 33f29081 编写于 作者: A Alex Dewar 提交者: Neil Armstrong

drm/bridge: dw-mipi-dsi: Use kmemdup cf. kmalloc+memcpy

kmemdup can be used instead of kmalloc+memcpy. Replace an occurrence of
this pattern.

Issue identified with Coccinelle.
Signed-off-by: NAlex Dewar <alex.dewar90@gmail.com>
Acked-by: NNeil Armstrong <narmstrong@baylibre.com>
Signed-off-by: NNeil Armstrong <narmstrong@baylibre.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200909190213.156302-1-alex.dewar90@gmail.com
上级 48e07c23
......@@ -1049,12 +1049,10 @@ static void debugfs_create_files(void *data)
};
int i;
dsi->debugfs_vpg = kmalloc(sizeof(debugfs), GFP_KERNEL);
dsi->debugfs_vpg = kmemdup(debugfs, sizeof(debugfs), GFP_KERNEL);
if (!dsi->debugfs_vpg)
return;
memcpy(dsi->debugfs_vpg, debugfs, sizeof(debugfs));
for (i = 0; i < ARRAY_SIZE(debugfs); i++)
debugfs_create_file(dsi->debugfs_vpg[i].name, 0644,
dsi->debugfs, &dsi->debugfs_vpg[i],
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册