Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1783882imm; Thu, 9 Aug 2018 01:45:43 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyFwBjXmYKOGJDzq8HAuB6gPoivzgfJZRSv3lq5TmkyFiVcOYRV+U6shOJK5mFkmAHQKHED X-Received: by 2002:a65:428b:: with SMTP id j11-v6mr1258566pgp.200.1533804343213; Thu, 09 Aug 2018 01:45:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533804343; cv=none; d=google.com; s=arc-20160816; b=qxp+xhRLDYuLtX03OPMHnE/pv0LZfx6UsvXFNzaFqR76W1oWajsJhvnL/8JfQskeTO R76JolYrJkqzXX+x4LxZR/cI7jar9y8itPTZ+2uPEXMues9uSvhH+fd5vi+ibyuInnye 9+KvSHNojtNsTH+aex7i0U/LAbqNh/jW9bvRuaRoOMJPiRk6sHjYda95zDflS/JaMm2H wisD7BygnI1fyrFYzNhJqKWmRrrkshXwn2xLhZv9bpUdi/parElNJfG3tWuJ8/otfru3 GnelvIm+5/09gRx2UjCnUf5E07RcCzO2ha3meqK7GqeuGAlXSxXFCu4GHiHc/xmrjIEX Y6Kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject:arc-authentication-results; bh=rShoQ8433/EBZOG6BM9PR9+TZlxPqHlg2r4nZPIbbBo=; b=ktC5VKtUBxBEK/NsP/6AZmGLVoHJwg4xUH0UYpRIQHHVJ+bCe1LxgqRvWz0DJ5xSHs zK6UWnL7vhdPWcG4VrF2kgqejsbt3oTv8/PfUGJXaa0uK8GZJ5yEGnF/AQnXWkfOnhII SUbpRqa9XSlHtWgqrexAGGESoc0eiHfzz0YMuolObebEuKo7orNO//lugM8ezvr2IOem MPVBvzScZozbV99/ew2chSuOmk3Pzi++xBP3tBNN4F5NciILhX9YA3pY24h+Py1jHsPa JnVneb1Kpsbyo24bsbs3v+78AeVbymtCoDdkF6fyt+uetTw2U6nhEJAUSGdkoY/vEMpl jMPg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o4-v6si5939364pgb.279.2018.08.09.01.45.28; Thu, 09 Aug 2018 01:45:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730004AbeHILI2 (ORCPT + 99 others); Thu, 9 Aug 2018 07:08:28 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:45375 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727601AbeHILI2 (ORCPT ); Thu, 9 Aug 2018 07:08:28 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id C1A03B64E5AE; Thu, 9 Aug 2018 16:44:35 +0800 (CST) Received: from [127.0.0.1] (10.177.31.96) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.399.0; Thu, 9 Aug 2018 16:44:33 +0800 Subject: Re: [PATCH net-next] ieee802154: Use kmemdup instead of duplicating it in ca8210_test_int_driver_write To: Stefan Schmidt , , , References: <20180809064429.13348-1-yuehaibing@huawei.com> <488f54b7-cfe2-f64b-168e-11f79d4d4e96@datenfreihafen.org> CC: , , From: YueHaibing Message-ID: Date: Thu, 9 Aug 2018 16:44:32 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <488f54b7-cfe2-f64b-168e-11f79d4d4e96@datenfreihafen.org> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.31.96] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018/8/9 16:13, Stefan Schmidt wrote: > Hello. > > On 08/09/2018 08:44 AM, YueHaibing wrote: >> Replace calls to kmalloc followed by a memcpy with a direct call to >> kmemdup. >> >> Signed-off-by: YueHaibing > > Is Yue your forname and Haibing your surname? In that case having it > written as > > Yue Haibing Well, It should be this, but it's been a long time to use the former > > in the from line as well as in the SOB would be better. > >> --- >> drivers/net/ieee802154/ca8210.c | 3 +-- >> 1 file changed, 1 insertion(+), 2 deletions(-) >> >> diff --git a/drivers/net/ieee802154/ca8210.c b/drivers/net/ieee802154/ca8210.c >> index 58299fb..e21279d 100644 >> --- a/drivers/net/ieee802154/ca8210.c >> +++ b/drivers/net/ieee802154/ca8210.c >> @@ -634,10 +634,9 @@ static int ca8210_test_int_driver_write( >> for (i = 0; i < len; i++) >> dev_dbg(&priv->spi->dev, "%#03x\n", buf[i]); >> >> - fifo_buffer = kmalloc(len, GFP_KERNEL); >> + fifo_buffer = kmemdup(buf, len, GFP_KERNEL); >> if (!fifo_buffer) >> return -ENOMEM; >> - memcpy(fifo_buffer, buf, len); >> kfifo_in(&test->up_fifo, &fifo_buffer, 4); >> wake_up_interruptible(&priv->test.readq); > > Is this some kernel tree wide change you are submitting patches for or > only for the ca8210 driver? Is there any specific problem you see with > the kmalloc and memcpy code here? To me it looks fine. > > The reason I ask is to understand if this is bug fix or a cleanup. It just a code cleanup only for ca8210. > > Harry, if you are ok with this one let me know with an Acked-By > > regards > Stefan Schmidt > > . >