Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755663AbbLGKIc (ORCPT ); Mon, 7 Dec 2015 05:08:32 -0500 Received: from mail-wm0-f49.google.com ([74.125.82.49]:38676 "EHLO mail-wm0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754193AbbLGKIa (ORCPT ); Mon, 7 Dec 2015 05:08:30 -0500 MIME-Version: 1.0 In-Reply-To: <1449089027-11158-1-git-send-email-geyslan@gmail.com> References: <1449089027-11158-1-git-send-email-geyslan@gmail.com> Date: Mon, 7 Dec 2015 11:08:29 +0100 Message-ID: Subject: Re: [PATCH 3/3] usb: xhci: replace dma_pool_alloc and memset with dma_pool_zalloc From: Peter Senna Tschudin To: "Geyslan G. Bem" Cc: Mathias Nyman , Greg Kroah-Hartman , linux-usb@vger.kernel.org, "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2051 Lines: 60 On Wed, Dec 2, 2015 at 9:43 PM, Geyslan G. Bem wrote: > Replace dma_pool_alloc and memset with a single call to dma_pool_zalloc. > > Caught by coccinelle. I would mention which script was used, but other than that: Acked-by: Peter Senna Tschudin > > Signed-off-by: Geyslan G. Bem > --- > drivers/usb/host/xhci-mem.c | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c > index c48cbe7..d034f92 100644 > --- a/drivers/usb/host/xhci-mem.c > +++ b/drivers/usb/host/xhci-mem.c > @@ -47,13 +47,12 @@ static struct xhci_segment *xhci_segment_alloc(struct xhci_hcd *xhci, > if (!seg) > return NULL; > > - seg->trbs = dma_pool_alloc(xhci->segment_pool, flags, &dma); > + seg->trbs = dma_pool_zalloc(xhci->segment_pool, flags, &dma); > if (!seg->trbs) { > kfree(seg); > return NULL; > } > > - memset(seg->trbs, 0, TRB_SEGMENT_SIZE); > /* If the cycle state is 0, set the cycle bit to 1 for all the TRBs */ > if (cycle_state == 0) { > for (i = 0; i < TRBS_PER_SEGMENT; i++) > @@ -517,12 +516,12 @@ static struct xhci_container_ctx *xhci_alloc_container_ctx(struct xhci_hcd *xhci > if (type == XHCI_CTX_TYPE_INPUT) > ctx->size += CTX_SIZE(xhci->hcc_params); > > - ctx->bytes = dma_pool_alloc(xhci->device_pool, flags, &ctx->dma); > + ctx->bytes = dma_pool_zalloc(xhci->device_pool, flags, &ctx->dma); > if (!ctx->bytes) { > kfree(ctx); > return NULL; > } > - memset(ctx->bytes, 0, ctx->size); > + > return ctx; > } > > -- > 2.6.2 > -- Peter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/