Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2786004imm; Sun, 17 Jun 2018 04:23:18 -0700 (PDT) X-Google-Smtp-Source: ADUXVKI6rNr88uFFHOt3TQogzxXelAHU4JcQUyEYfCzTCpw/kjdBAWq9+k0lQqz+pUHAJaX90yBU X-Received: by 2002:a63:730d:: with SMTP id o13-v6mr7589929pgc.1.1529234598778; Sun, 17 Jun 2018 04:23:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529234598; cv=none; d=google.com; s=arc-20160816; b=jstaBFXRlJBCXxSG6uolg8SS4cV+gF/OIwFIFMcqx+tMU1RRFhMsDi1+cfhKwn3k2H AupEX8g+mYFu0i5f10d82ZHZft3svSPP/X+ZAOvdKnvB77jtOvfhuI9cibvWXyIYFO7P iIBL/WK3GB0i3le9h9wiloPl1OqiY1FM80gUf4MZYeP4bWHJxIKobltZlp4UE40eyBtX CDRp00qs4/sAxMSCmDIx8Ap7n2I9ybN4HQWd9Fe4HQpj4s0cdcBKuRrwUOxT+0T0Hc4z vVjqOxiB8Hined0cXQSkmzcDlLSQSDEG0e9Zb70vHz+gcCdCeCWx5eNPhwzXZIBYUs5K Nkdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=KAlHAnWqIR4Fgbaes7JJ9Pr99mtNMb9FPIWvEd+LvF4=; b=pmOtXkMgurU12S/j0PpyihaEczfIde2XP0M5RaYmBOzgaw0U3wqYuNgJfjg9b4ShVz Mv/1cDUWq0i37ZEICqC6t01fNe7FDyCAG7CxlSScnVl339JEtNv6zmADQB3iuUwM96dg OH6GyxAMzv0hePgMHSyeDavA+0gIUbVCybaBzNPXGSGpigAXY4j5Zfv97BAW3vr40TU6 JU8Bj/EZeRdUcwk6tykLXPIJnGWIaIdeuCjnfd0HpfxFAW8qk3sGYPVT99qJH0EbhGht 9yWVyLxiUYp5mJE5cP+BfC2XQNTgdDaK+/vQobMSiRikVNREnGCLWyg7mhq5/FwXlgHA jJRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=CEKkxZyf; 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 bc4-v6si11859118plb.254.2018.06.17.04.23.04; Sun, 17 Jun 2018 04:23:18 -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; dkim=pass header.i=@kernel.org header.s=default header.b=CEKkxZyf; 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 S1755174AbeFQLW1 (ORCPT + 99 others); Sun, 17 Jun 2018 07:22:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:53250 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755106AbeFQLW0 (ORCPT ); Sun, 17 Jun 2018 07:22:26 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D82FD20693; Sun, 17 Jun 2018 11:22:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1529234546; bh=vbVyhv3iFIDQ2PrmPIS+uKY5KPqoEEIrCIWf2knCXN4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=CEKkxZyfWwaLbVD0YqEHtfAvMKYIebCRW3W0cMBagxr+Cjri6OPnCGUFZ64Sx/mgb lDTCSnBqt3FvHRrpRqRPTashqpA20Jc9jtnf7DsfyIh4BnYqutzO57VDleqLqEg+6L Wg7AZNUzkjoDol0tGRjjDTiXTL34sqA3587tZxp8= Date: Sun, 17 Jun 2018 13:22:03 +0200 From: Greg KH To: Shreeya Patel Cc: oleg.drokin@intel.com, andreas.dilger@intel.com, jsimmons@infradead.org, lustre-devel@lists.lustre.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Staging: lustre: Use kmemdup() instead of kzalloc and memcpy Message-ID: <20180617112203.GA9357@kroah.com> References: <1529234215-4010-1-git-send-email-shreeya.patel23498@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1529234215-4010-1-git-send-email-shreeya.patel23498@gmail.com> User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jun 17, 2018 at 04:46:55PM +0530, Shreeya Patel wrote: > Replace calls to kzalloc or kmalloc followed by a memcpy with > a direct call to kmemdup to shorten the code. > > The Coccinelle semantic patch used to make this change is as follows: > @@ > expression from,to,size,flag; > statement S; > @@ > > - to = \(kmalloc\|kzalloc\)(size,flag); > + to = kmemdup(from,size,flag); > if (to==NULL || ...) S > - memcpy(to, from, size); > > Signed-off-by: Shreeya Patel > --- > drivers/staging/lustre/lnet/lnet/api-ni.c | 5 ++--- Always work off of the latest kernel tree. Ideally linux-next or the staging.git staging-next tree. Worse case, Linus's tree. But never off of an old kernel tree, that will only cause you to duplicate work that others have done :( Please resync against 4.18-rc1 and see why I say this when trying to apply your patch... thanks, greg k-h