mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: YueHaibing <yuehaibing@huawei.com>
To: Andrew Lunn <andrew@lunn.ch>,
	Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: <linux-kernel@vger.kernel.org>, <linuxppc-dev@lists.ozlabs.org>,
	<netdev@vger.kernel.org>, <rasmus.villemoes@prevas.dk>,
	<kuba@kernel.org>, <davem@davemloft.net>, <leoyang.li@nxp.com>
Subject: Re: [PATCH net-next] ethernet: ucc_geth: Use kmemdup() rather than kmalloc+memcpy
Date: Mon, 24 May 2021 09:07:40 +0800	[thread overview]
Message-ID: <cb42d735-e540-2ea4-2cd2-fc3e1bccd526@huawei.com> (raw)
In-Reply-To: <YKpmKln1Z/UvZgZQ@lunn.ch>

On 2021/5/23 22:26, Andrew Lunn wrote:
> On Sun, May 23, 2021 at 03:29:37PM +0200, Christophe Leroy wrote:
>> YueHaibing <yuehaibing@huawei.com> a écrit :
>>
>>> Issue identified with Coccinelle.
>>>
>>> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
>>> ---
>>>  drivers/net/ethernet/freescale/ucc_geth.c | 4 ++--
>>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/net/ethernet/freescale/ucc_geth.c
>>> b/drivers/net/ethernet/freescale/ucc_geth.c
>>> index e0936510fa34..51206272cc25 100644
>>> --- a/drivers/net/ethernet/freescale/ucc_geth.c
>>> +++ b/drivers/net/ethernet/freescale/ucc_geth.c
>>> @@ -3590,10 +3590,10 @@ static int ucc_geth_probe(struct
>>> platform_device* ofdev)
>>>  	if ((ucc_num < 0) || (ucc_num > 7))
>>>  		return -ENODEV;
>>>
>>> -	ug_info = kmalloc(sizeof(*ug_info), GFP_KERNEL);
>>> +	ug_info = kmemdup(&ugeth_primary_info, sizeof(*ug_info),
>>> +			  GFP_KERNEL);
>>
>> Can you keep that as a single line ? The tolerance is 100 chars per line now.
> 
> Networking prefers 80. If it fits a single 80 char line, please use a single line.
> Otherwise please leave it as it is.

Ok, will send v2.
> 
> 	   Andrew
> .
> 

      reply	other threads:[~2021-05-24  1:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-23  7:56 YueHaibing
2021-05-23 13:29 ` Christophe Leroy
2021-05-23 14:26   ` Andrew Lunn
2021-05-24  1:07     ` YueHaibing [this message]

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=cb42d735-e540-2ea4-2cd2-fc3e1bccd526@huawei.com \
    --to=yuehaibing@huawei.com \
    --cc=andrew@lunn.ch \
    --cc=christophe.leroy@csgroup.eu \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=leoyang.li@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=netdev@vger.kernel.org \
    --cc=rasmus.villemoes@prevas.dk \
    /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®