]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
USB: OHCI: use dma_pool_zalloc
authorshashi bhusan <shashibhu.linux@gmail.com>
Sun, 20 Nov 2016 10:58:50 +0000 (16:28 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 21 Nov 2016 16:33:40 +0000 (17:33 +0100)
We should use new API dma_pool_zalloc instead of dma_pool_alloc/memset.

Signed-off-by: Shashi Bhusan <shashibhushan4u123@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/ohci-mem.c

index c9e315c6808aa77d1e491507d58e7612e14465cc..ed8a762b8670395e9b2eababd1408d11e68d46b0 100644 (file)
@@ -88,10 +88,9 @@ td_alloc (struct ohci_hcd *hc, gfp_t mem_flags)
        dma_addr_t      dma;
        struct td       *td;
 
-       td = dma_pool_alloc (hc->td_cache, mem_flags, &dma);
+       td = dma_pool_zalloc (hc->td_cache, mem_flags, &dma);
        if (td) {
                /* in case hc fetches it, make it look dead */
-               memset (td, 0, sizeof *td);
                td->hwNextTD = cpu_to_hc32 (hc, dma);
                td->td_dma = dma;
                /* hashed in td_fill */
@@ -122,9 +121,8 @@ ed_alloc (struct ohci_hcd *hc, gfp_t mem_flags)
        dma_addr_t      dma;
        struct ed       *ed;
 
-       ed = dma_pool_alloc (hc->ed_cache, mem_flags, &dma);
+       ed = dma_pool_zalloc (hc->ed_cache, mem_flags, &dma);
        if (ed) {
-               memset (ed, 0, sizeof (*ed));
                INIT_LIST_HEAD (&ed->td_list);
                ed->dma = dma;
        }