Skip to content

Commit

Permalink
usb: host: ehci: Make use of dma_pool_zalloc() instead of dma_pool_al…
Browse files Browse the repository at this point in the history
…loc/memset()

Replacing dma_pool_alloc/memset() with dma_pool_zalloc()
to simplify the code.

Signed-off-by: Cai Huoqing <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
caihuoqing1990 authored and gregkh committed Oct 21, 2021
1 parent 81dddf7 commit 6a47856
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/usb/host/ehci-mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,9 @@ static struct ehci_qh *ehci_qh_alloc (struct ehci_hcd *ehci, gfp_t flags)
if (!qh)
goto done;
qh->hw = (struct ehci_qh_hw *)
dma_pool_alloc(ehci->qh_pool, flags, &dma);
dma_pool_zalloc(ehci->qh_pool, flags, &dma);
if (!qh->hw)
goto fail;
memset(qh->hw, 0, sizeof *qh->hw);
qh->qh_dma = dma;
// INIT_LIST_HEAD (&qh->qh_list);
INIT_LIST_HEAD (&qh->qtd_list);
Expand Down

0 comments on commit 6a47856

Please sign in to comment.