[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <31a4cfbe-2c23-cda2-2d92-9d15a5d4bcb3@linux.intel.com>
Date: Tue, 7 Feb 2023 17:11:23 +0200
From: Mathias Nyman <mathias.nyman@...ux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: Mathias Nyman <mathias.nyman@...el.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [PATCH v1 2/7] xhci: mem: Use __GFP_ZERO instead of explicit
memset() call
On 6.2.2023 18.10, Andy Shevchenko wrote:
> Use __GFP_ZERO instead of explicit memset() call in
> xhci_alloc_stream_ctx().
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> ---
> drivers/usb/host/xhci-mem.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
> index c385513ad00b..768adcb544a7 100644
> --- a/drivers/usb/host/xhci-mem.c
> +++ b/drivers/usb/host/xhci-mem.c
> @@ -571,6 +571,8 @@ static struct xhci_stream_ctx *xhci_alloc_stream_ctx(struct xhci_hcd *xhci,
> struct device *dev = xhci_to_hcd(xhci)->self.sysdev;
> size_t size = size_mul(sizeof(struct xhci_stream_ctx), num_stream_ctxs);
>
> + mem_flags |= __GFP_ZERO;
> +
How about calling dma_pool_zalloc() instead of setting __GFP_ZERO flag?
Memory returned by dma_alloc_coherent() should already be zeroed if I remember correctly
-Mathias
Powered by blists - more mailing lists