Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751169AbdL3S0K (ORCPT ); Sat, 30 Dec 2017 13:26:10 -0500 Received: from mail-pl0-f68.google.com ([209.85.160.68]:34987 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751012AbdL3S0I (ORCPT ); Sat, 30 Dec 2017 13:26:08 -0500 X-Google-Smtp-Source: ACJfBosHf5GRv4ZPdZGx9stlT8pfcEcbT4wVfZshV4Y9FG9L+5A/hbYb39wYjpfaHclMQPHhtVVIpw== Date: Sat, 30 Dec 2017 23:55:59 +0530 From: Himanshu Jha To: Alan Stern Cc: gregkh@linuxfoundation.org, mathias.nyman@intel.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, mcgrof@kernel.org Subject: Re: [PATCH] USB: host: Use zeroing memory allocator rather than allocator/memset Message-ID: <20171230182559.GA8593@himanshu-Vostro-3559> References: <1514648539-7038-1-git-send-email-himanshujha199640@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1403 Lines: 40 On Sat, Dec 30, 2017 at 11:41:19AM -0500, Alan Stern wrote: > On Sat, 30 Dec 2017, Himanshu Jha wrote: > > > Use dma_zalloc_coherent for allocating zeroed > > memory and remove unnecessary memset function. > > > > Done using Coccinelle. > > Generated-by: scripts/coccinelle/api/alloc/kzalloc-simple.cocci > > 0-day tested with no failures. > > > > Suggested-by: Luis R. Rodriguez > > Signed-off-by: Himanshu Jha > > --- > > drivers/usb/host/uhci-hcd.c | 7 +++---- > > drivers/usb/host/xhci-mem.c | 7 ++----- > > 2 files changed, 5 insertions(+), 9 deletions(-) > > > > diff --git a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c > > index f5c9021..ac53398 100644 > > --- a/drivers/usb/host/uhci-hcd.c > > +++ b/drivers/usb/host/uhci-hcd.c > > @@ -600,15 +600,14 @@ static int uhci_start(struct usb_hcd *hcd) > > uhci->dentry = dentry; > > #endif > > > > - uhci->frame = dma_alloc_coherent(uhci_dev(uhci), > > - UHCI_NUMFRAMES * sizeof(*uhci->frame), > > - &uhci->frame_dma_handle, GFP_KERNEL); > > + uhci->frame = dma_zalloc_coherent(uhci_dev(uhci), > > + UHCI_NUMFRAMES * sizeof(*uhci->frame), > > + &uhci->frame_dma_handle, GFP_KERNEL); > > Please don't change the existing whitespace scheme when you make > changes like this one. Thanks for the feedback! Do I need to send v2 for this ? Thanks Himanshu Jha