Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2676344pxj; Sun, 23 May 2021 07:28:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwmSywdyu5OnDOnxMHrYRbWkDH7wsRq1eC0Js+Jxy2uyiUFp44Y2aDRdwuMSvm1pI/YrJTu X-Received: by 2002:a50:f744:: with SMTP id j4mr20849885edn.211.1621780109136; Sun, 23 May 2021 07:28:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621780109; cv=none; d=google.com; s=arc-20160816; b=Bmk2IlxPkvpAIysB+WPOQtZoMkYueAiSuQm7S8HPw4kdnuVCjUTjA4hCzIy/IAW6lQ jMl5/TIXVEkMZ+HRqDVA1LvnCiwHaYv7dO/2exN/hcaMToKtxa/n+g6P+Tu695WxBbkn OwZzBrE5mHDE/pHPHAEEpoxM3oClz9ngkZ4wjIYRCET18jHrELHYPk1oNsFM0Z99UA91 P+1lwqxFB/2vZvWJubQ480heCOa8ALTqpNgOq4XHIKzqv062ddt6HG2cI9lnavZs5KhM F4kurUiTvqHf972GfIRR8klThOvhgRwpwOX+WmNWdVKnoIsY6ASWXWCV/ms48V0weuEx axNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=cO97GQt7mIQ0ZMqdaTb0HibQ77osXtd0Ea5KRZD1PD8=; b=JK3d2QcicsFVgeiItS9jIvXBg+31bF2ORqae4EvFOyuxffPrkCFXMI7YupIUjn1Trt Y/Tvrz1h82UU//mx2hydwIDZpS/lH3Bz62zGks/Xxsa26w1zzEkySJehxCrR/CwK3y4e NjXHsXHMXKzBcMRikzOGPhj8yr6MpzH5XtgKRWpqM+VZCKYta+XRDvgqGMjU0jZk2EKA qao3NkIU9u3a3aDbu/rmhe65ygpNUYrg5g7WPjXQ+nraCy9zINkOrkwEJ5DdQh7JaYmW Lfi5p7knhtLCQvcAVbB7kn2+DWBKcqlx87z0tD/S7idYAEa0flXWIGuHiVd+4k5RG4GY ypkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=m83mZcoK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m9si8439470ejj.645.2021.05.23.07.28.05; Sun, 23 May 2021 07:28:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=m83mZcoK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231800AbhEWO2e (ORCPT + 99 others); Sun, 23 May 2021 10:28:34 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:53236 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231766AbhEWO2e (ORCPT ); Sun, 23 May 2021 10:28:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Transfer-Encoding:Content-Disposition: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:From: Sender:Reply-To:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Content-Disposition: In-Reply-To:References; bh=cO97GQt7mIQ0ZMqdaTb0HibQ77osXtd0Ea5KRZD1PD8=; b=m8 3mZcoKNanSeG+LzXhY4bt7KTO7qR7ZWahRLy9Nz22llXW9Fmiu8bnyBRGFX583JgPqWgr8kmJL7Dn sRdZ9oDBdLYUvCIdNMGzMuzQgyZfU0mKOSPuvsIJeH+//NJ/2fe3nFLBgIvxH77LyKLxLP8496efq elPtFT2803BeItc=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1lkp46-005mqx-9n; Sun, 23 May 2021 16:26:50 +0200 Date: Sun, 23 May 2021 16:26:50 +0200 From: Andrew Lunn To: Christophe Leroy Cc: YueHaibing , 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 Message-ID: References: <20210523075616.14792-1-yuehaibing@huawei.com> <20210523152937.Horde.5kC0kzvaP3No5BC63LlZ_A7@messagerie.c-s.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210523152937.Horde.5kC0kzvaP3No5BC63LlZ_A7@messagerie.c-s.fr> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, May 23, 2021 at 03:29:37PM +0200, Christophe Leroy wrote: > YueHaibing a ?crit?: > > > Issue identified with Coccinelle. > > > > Signed-off-by: YueHaibing > > --- > > 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. Andrew