public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Mathias Nyman <mathias.nyman@intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH v1 2/7] xhci: mem: Use __GFP_ZERO instead of explicit memset() call
Date: Tue, 7 Feb 2023 17:11:23 +0200	[thread overview]
Message-ID: <31a4cfbe-2c23-cda2-2d92-9d15a5d4bcb3@linux.intel.com> (raw)
In-Reply-To: <20230206161049.13972-3-andriy.shevchenko@linux.intel.com>

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@linux.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



  reply	other threads:[~2023-02-07 15:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-06 16:10 [PATCH v1 0/7] xhci: mem: Short cleanup series Andy Shevchenko
2023-02-06 16:10 ` [PATCH v1 1/7] xhci: mem: Carefully calculate size for memory allocations Andy Shevchenko
2023-02-06 16:10 ` [PATCH v1 2/7] xhci: mem: Use __GFP_ZERO instead of explicit memset() call Andy Shevchenko
2023-02-07 15:11   ` Mathias Nyman [this message]
2023-02-07 22:49     ` Andy Shevchenko
2023-02-06 16:10 ` [PATCH v1 3/7] xhci: mem: Get rid of redundant 'else' Andy Shevchenko
2023-02-06 16:10 ` [PATCH v1 4/7] xhci: mem: Drop useless return:s Andy Shevchenko
2023-02-06 16:10 ` [PATCH v1 5/7] xhci: mem: Use while (i--) pattern to clean up Andy Shevchenko
2023-02-06 16:10 ` [PATCH v1 6/7] xhci: mem: Replace explicit castings with appropriate specifiers Andy Shevchenko
2023-02-06 16:10 ` [PATCH v1 7/7] xhci: mem: Join string literals back Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=31a4cfbe-2c23-cda2-2d92-9d15a5d4bcb3@linux.intel.com \
    --to=mathias.nyman@linux.intel.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox