public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Christoph Hellwig <hch@lst.de>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: linux-pci@vger.kernel.org, linux-media@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] media/ttusb-budget: remove pci_zalloc_coherent abuse
Date: Tue, 09 Jan 2018 12:49:26 -0800	[thread overview]
Message-ID: <1515530966.9619.124.camel@perches.com> (raw)
In-Reply-To: <20180109203939.5930-2-hch@lst.de>

On Tue, 2018-01-09 at 21:39 +0100, Christoph Hellwig wrote:
> Switch to a plain kzalloc instea of pci_zalloc_coherent to allocate
> memory for the USB DMA.
[]
> diff --git a/drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c b/drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c
[]
> @@ -792,21 +791,15 @@ static void ttusb_free_iso_urbs(struct ttusb *ttusb)
> []
>  static int ttusb_alloc_iso_urbs(struct ttusb *ttusb)
>  {
>  	int i;
>  
> -	ttusb->iso_buffer = pci_zalloc_consistent(NULL,
> -						  ISO_FRAME_SIZE * FRAMES_PER_ISO_BUF * ISO_BUF_COUNT,
> -						  &ttusb->iso_dma_handle);
> -
> +	ttusb->iso_buffer = kzalloc(ISO_FRAME_SIZE * FRAMES_PER_ISO_BUF *
> +			ISO_BUF_COUNT, GFP_KERNEL);
>  	if (!ttusb->iso_buffer) {
>  		dprintk("%s: pci_alloc_consistent - not enough memory\n",
>  			__func__);

This message doesn't make sense anymore and it might as well
be deleted.

And it might be better to use kcalloc

	ttusb->iso_buffer = kcalloc(FRAMES_PER_ISO_BUF * ISO_BUF_COUNT,
				    ISO_FRAME_SIZE, GFP_KERNEL);

  reply	other threads:[~2018-01-09 20:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-09 20:39 remove pci_dma_* abuses and workarounds Christoph Hellwig
2018-01-09 20:39 ` [PATCH 1/3] media/ttusb-budget: remove pci_zalloc_coherent abuse Christoph Hellwig
2018-01-09 20:49   ` Joe Perches [this message]
2018-01-10  8:17     ` Christoph Hellwig
2018-01-09 23:45   ` Bjorn Helgaas
2018-01-09 20:39 ` [PATCH 2/3] media/ttusb-dev: " Christoph Hellwig
2018-01-09 20:39 ` [PATCH 3/3] pci-dma-compat: remove handling of NULL pdev arguments Christoph Hellwig
2018-01-10  0:25   ` Bjorn Helgaas
2018-01-10  8:14     ` Christoph Hellwig

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=1515530966.9619.124.camel@perches.com \
    --to=joe@perches.com \
    --cc=bhelgaas@google.com \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=mchehab@kernel.org \
    /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