Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751005AbdL3T1C (ORCPT ); Sat, 30 Dec 2017 14:27:02 -0500 Received: from netrider.rowland.org ([192.131.102.5]:50819 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1750891AbdL3T1B (ORCPT ); Sat, 30 Dec 2017 14:27:01 -0500 Date: Sat, 30 Dec 2017 14:26:59 -0500 (EST) From: Alan Stern X-X-Sender: stern@netrider.rowland.org To: Himanshu Jha cc: gregkh@linuxfoundation.org, , , , Subject: Re: [PATCH] USB: host: Use zeroing memory allocator rather than allocator/memset In-Reply-To: <20171230182559.GA8593@himanshu-Vostro-3559> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1532 Lines: 43 On Sat, 30 Dec 2017, Himanshu Jha wrote: > 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 ? Okay, yes, go ahead. Alan Stern