[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1515530966.9619.124.camel@perches.com>
Date: Tue, 09 Jan 2018 12:49:26 -0800
From: Joe Perches <joe@...ches.com>
To: Christoph Hellwig <hch@....de>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>
Cc: linux-pci@...r.kernel.org, linux-media@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/3] media/ttusb-budget: remove pci_zalloc_coherent abuse
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);
Powered by blists - more mailing lists