diff options
author | Alex Dewar <alex.dewar90@gmail.com> | 2020-09-09 20:02:08 +0100 |
---|---|---|
committer | Neil Armstrong <narmstrong@baylibre.com> | 2020-09-11 15:00:52 +0200 |
commit | 33f290811d4c1a09c4e92f5bf0458525835dbcba (patch) | |
tree | 00127b56604cfd36e54a2a33193947e954dc398c | |
parent | 48e07c23cbeba2a2cda7ca73be0015e727818536 (diff) | |
download | linux-33f290811d4c1a09c4e92f5bf0458525835dbcba.tar.bz2 |
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: Alex Dewar <alex.dewar90@gmail.com>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200909190213.156302-1-alex.dewar90@gmail.com
-rw-r--r-- | drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c index 52f5c5a2ed64..7e9a62ad56e8 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c @@ -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], |