]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
usb: host: Remove call to memset after dma_alloc_coherent
authorFuqian Huang <huangfq.daxian@gmail.com>
Mon, 15 Jul 2019 03:20:10 +0000 (11:20 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Jul 2019 09:10:54 +0000 (11:10 +0200)
In commit 518a2f1925c3
("dma-mapping: zero memory returned from dma_alloc_*"),
dma_alloc_coherent has already zeroed the memory.
So memset is not needed.

Signed-off-by: Fuqian Huang <huangfq.daxian@gmail.com>
Link: https://lore.kernel.org/r/20190715032010.7258-1-huangfq.daxian@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-dbgcap.c
drivers/usb/host/xhci-mem.c

index 52e32644a4b2fb4ea25a8d7270d883726ced2b94..93e2cca5262d16ffbdc7c96586cff3d1eb397924 100644 (file)
@@ -22,7 +22,6 @@ dbc_dma_alloc_coherent(struct xhci_hcd *xhci, size_t size,
 
        vaddr = dma_alloc_coherent(xhci_to_hcd(xhci)->self.sysdev,
                                   size, dma_handle, flags);
-       memset(vaddr, 0, size);
        return vaddr;
 }
 
index cf5e1796217987fcd482600047aadc240a9f0384..e16eda6e2b8b22b768387a5c0c2a5091c4573059 100644 (file)
@@ -2399,7 +2399,6 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags)
                        flags);
        if (!xhci->dcbaa)
                goto fail;
-       memset(xhci->dcbaa, 0, sizeof *(xhci->dcbaa));
        xhci->dcbaa->dma = dma;
        xhci_dbg_trace(xhci, trace_xhci_dbg_init,
                        "// Device context base array address = 0x%llx (DMA), %p (virt)",