mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Neil Armstrong <narmstrong@baylibre.com>
To: Daniel Vetter <daniel@ffwll.ch>, Alex Dewar <alex.dewar90@gmail.com>
Cc: "Andrzej Hajda" <a.hajda@samsung.com>,
	"Laurent Pinchart" <Laurent.pinchart@ideasonboard.com>,
	"Jonas Karlman" <jonas@kwiboo.se>,
	"Jernej Skrabec" <jernej.skrabec@siol.net>,
	"David Airlie" <airlied@linux.ie>,
	"Philippe Cornu" <philippe.cornu@st.com>,
	"Yannick Fertré" <yannick.fertre@st.com>,
	"Antonio Borneo" <antonio.borneo@st.com>,
	"Heiko Stuebner" <heiko.stuebner@theobroma-systems.com>,
	"Angelo Ribeiro" <Angelo.Ribeiro@synopsys.com>,
	"Markus Elfring" <elfring@users.sourceforge.net>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] drm/bridge: dw-mipi-dsi: Use kmemdup cf. kmalloc+memcpy
Date: Mon, 21 Sep 2020 11:58:41 +0200	[thread overview]
Message-ID: <7450528b-4204-ce6e-63ed-0976ba412dd5@baylibre.com> (raw)
In-Reply-To: <CAKMK7uEwQhdqmU4+Ri+M9JtYqMmetmK8p9uFrhx1Lp16g=1edA@mail.gmail.com>

On 20/09/2020 10:24, Daniel Vetter wrote:
> On Sat, Sep 19, 2020 at 9:31 PM Alex Dewar <alex.dewar90@gmail.com> wrote:
>>
>> On 2020-09-11 13:57, Neil Armstrong wrote:
>>> On 09/09/2020 21:02, Alex Dewar wrote:
>>>> kmemdup can be used instead of kmalloc+memcpy. Replace an occurrence of
>>>> this pattern.
>> Friendly ping?
>>>>
>>>> Issue identified with Coccinelle.
>>>>
>>>> Signed-off-by: Alex Dewar <alex.dewar90@gmail.com>
>>>> ---
>>>>   drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 4 +---
>>>>   1 file changed, 1 insertion(+), 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],
>>>>
>>> Acked-by: Neil Armstrong <narmstrong@baylibre.com>
> 
> Neil has commit rights, so I was assuming he'd push this to drm-misc-next.
> -Daniel
> 

Hmm, I applied this already:
commit 33f290811d4c1a09c4e92f5bf0458525835dbcba
Author: Alex Dewar <alex.dewar90@gmail.com>
Date:   Wed Sep 9 20:02:08 2020 +0100

    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

Neil

  parent reply	other threads:[~2020-09-21  9:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-09 19:02 Alex Dewar
2020-09-11 12:57 ` Neil Armstrong
2020-09-19 19:31   ` Alex Dewar
2020-09-20  8:24     ` Daniel Vetter
2020-09-21  9:55       ` Neil Armstrong
2020-09-21  9:58       ` Neil Armstrong [this message]
2020-09-21 10:13         ` Alex Dewar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7450528b-4204-ce6e-63ed-0976ba412dd5@baylibre.com \
    --to=narmstrong@baylibre.com \
    --cc=Angelo.Ribeiro@synopsys.com \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=a.hajda@samsung.com \
    --cc=airlied@linux.ie \
    --cc=alex.dewar90@gmail.com \
    --cc=antonio.borneo@st.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=elfring@users.sourceforge.net \
    --cc=heiko.stuebner@theobroma-systems.com \
    --cc=jernej.skrabec@siol.net \
    --cc=jonas@kwiboo.se \
    --cc=linux-kernel@vger.kernel.org \
    --cc=philippe.cornu@st.com \
    --cc=yannick.fertre@st.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®