lkml.org 
[lkml]   [2018]   [Jan]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] USB: host: Use zeroing memory allocator rather than allocator/memset
On Sun, Dec 31, 2017 at 04:20:45PM -0500, Alan Stern wrote:
> On Sun, 31 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 <mcgrof@kernel.org>
> > Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
> > ---
> > v2:
> > -align argumenst as they were before applying the SmPL rule.
>
> For the UHCI portion:
>
> Acked-by: Alan Stern <stern@rowland.harvard.edu>
>
> But there is something pecular about the patch...
>
> > 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);
>
> The second and third "changed" lines here actually are identical. What
> program would produce a diff file showing that they were changed?

I'm sorry, I can't understand the problem.
The patch was generated by cocci script specified above and then you
told me to change the whitespace scheme as it was before. It is also
0-day tested as specified above. It's also free from warnings reported by
checkpatch.

If are still confused please take a look at the rule :
https://lkml.org/lkml/2017/12/26/205
which will be soon merged to the linux-next tree.

Thanks
Himanshu Jha

\
 
 \ /
  Last update: 2018-01-01 14:53    [W:0.032 / U:2.080 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site