Linux USB
 help / color / mirror / Atom feed
From: Himanshu Jha <himanshujha199640@gmail.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: gregkh@linuxfoundation.org, mathias.nyman@intel.com,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	mcgrof@kernel.org
Subject: [v2] USB: host: Use zeroing memory allocator rather than allocator/memset
Date: Mon, 1 Jan 2018 21:29:42 +0530	[thread overview]
Message-ID: <20180101155942.GA10108@himanshu-Vostro-3559> (raw)

On Mon, Jan 01, 2018 at 10:53:07AM -0500, Alan Stern wrote:
> On Mon, 1 Jan 2018, Himanshu Jha wrote:
> 
> > 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.
> 
> There is no problem.  I merely asked a question.
> 
> > The patch was generated by cocci script specified above and then you
> > told me to change the whitespace scheme as it was before.
> 
> Yes, I know.  But did you change the cocci script to make it produce
> this new patch, or did you make the patch by manually editing the old
> version?  In other words, how was this patch generated?

I did that manually, no change in cocci script.

Thanks
Himanshu Jha
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

             reply	other threads:[~2018-01-01 15:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-01 15:59 Himanshu Jha [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-01-02 10:13 [v2] USB: host: Use zeroing memory allocator rather than allocator/memset Mathias Nyman
2018-01-01 15:53 Alan Stern
2018-01-01 13:51 Himanshu Jha
2017-12-31 21:20 Alan Stern
2017-12-30 20:03 Himanshu Jha

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180101155942.GA10108@himanshu-Vostro-3559 \
    --to=himanshujha199640@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.com \
    --cc=mcgrof@kernel.org \
    --cc=stern@rowland.harvard.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox