summaryrefslogtreecommitdiff
path: root/drivers/usb/host/uhci-hcd.c
diff options
context:
space:
mode:
authorHimanshu Jha <himanshujha199640@gmail.com>2017-12-30 23:03:52 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-01-04 19:03:15 +0300
commit2b80a29bf83d2baed1a22193647bafcc6a0426af (patch)
tree7081bb3902ffa221224dad0f160af26690b15cf3 /drivers/usb/host/uhci-hcd.c
parentd19000b885beea01947b8ed94506afe7dc4ab91b (diff)
downloadlinux-2b80a29bf83d2baed1a22193647bafcc6a0426af.tar.xz
USB: host: Use zeroing memory allocator rather than allocator/memset
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> Acked-by: Alan Stern <stern@rowland.harvard.edu> Acked-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/uhci-hcd.c')
-rw-r--r--drivers/usb/host/uhci-hcd.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c
index f5c90217777a..f9c3947577fc 100644
--- a/drivers/usb/host/uhci-hcd.c
+++ b/drivers/usb/host/uhci-hcd.c
@@ -600,7 +600,7 @@ static int uhci_start(struct usb_hcd *hcd)
uhci->dentry = dentry;
#endif
- uhci->frame = dma_alloc_coherent(uhci_dev(uhci),
+ uhci->frame = dma_zalloc_coherent(uhci_dev(uhci),
UHCI_NUMFRAMES * sizeof(*uhci->frame),
&uhci->frame_dma_handle, GFP_KERNEL);
if (!uhci->frame) {
@@ -608,7 +608,6 @@ static int uhci_start(struct usb_hcd *hcd)
"unable to allocate consistent memory for frame list\n");
goto err_alloc_frame;
}
- memset(uhci->frame, 0, UHCI_NUMFRAMES * sizeof(*uhci->frame));
uhci->frame_cpu = kcalloc(UHCI_NUMFRAMES, sizeof(*uhci->frame_cpu),
GFP_KERNEL);