From patchwork Tue Jan 9 20:39:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 10153285 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DDE7F601A1 for ; Tue, 9 Jan 2018 20:40:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DBE4A1FFEB for ; Tue, 9 Jan 2018 20:40:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D03071FFFF; Tue, 9 Jan 2018 20:40:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 81F672000A for ; Tue, 9 Jan 2018 20:40:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756047AbeAIUjw (ORCPT ); Tue, 9 Jan 2018 15:39:52 -0500 Received: from bombadil.infradead.org ([65.50.211.133]:60798 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755883AbeAIUjt (ORCPT ); Tue, 9 Jan 2018 15:39:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=5dqBBvI/56QqauunWEHCcUPc5YQIZnGgzAdgy3bTSGw=; b=RXg/r5Rn3lqwAjCgKdBYwxU8t uJUHiS/CArMnJ7DQa5XtWJjMwXE3QImMMQC7aDPof+21EeH/TEL5kFQ/7A6QvzmrcQc54GbTMi7Fv Z0q943+c1hqRBDuV+1hUTMzjTx44mBuzRlUVB6+0VvSYsoeu78OXSBm4FUGERcfP0pTh8pQmuh457 pK3CanKABNozzUiyZtrVM9tr6FdkJy/ZfjnDn9k7oTNGvLp9K7D4LkAqFnbIl85ptdM60K83vjGRg UsKltP8MN7ZNHk+Bfw5Jpto75DP+0eQX2dHE85TxgW1iVKqF6cwisDs42uIO2mout99utWMCPRZHC VzA6J0qRQ==; Received: from clnet-p099-196.ikbnet.co.at ([83.175.99.196] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.89 #1 (Red Hat Linux)) id 1eZ0gW-0002zF-63; Tue, 09 Jan 2018 20:39:48 +0000 From: Christoph Hellwig To: Bjorn Helgaas , Mauro Carvalho Chehab Cc: linux-pci@vger.kernel.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] media/ttusb-budget: remove pci_zalloc_coherent abuse Date: Tue, 9 Jan 2018 21:39:37 +0100 Message-Id: <20180109203939.5930-2-hch@lst.de> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20180109203939.5930-1-hch@lst.de> References: <20180109203939.5930-1-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Switch to a plain kzalloc instea of pci_zalloc_coherent to allocate memory for the USB DMA. Signed-off-by: Christoph Hellwig --- drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c b/drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c index a142b9dc0feb..b8619fb23351 100644 --- a/drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c +++ b/drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c @@ -102,7 +102,6 @@ struct ttusb { unsigned int isoc_in_pipe; void *iso_buffer; - dma_addr_t iso_dma_handle; struct urb *iso_urb[ISO_BUF_COUNT]; @@ -792,21 +791,15 @@ static void ttusb_free_iso_urbs(struct ttusb *ttusb) for (i = 0; i < ISO_BUF_COUNT; i++) usb_free_urb(ttusb->iso_urb[i]); - - pci_free_consistent(NULL, - ISO_FRAME_SIZE * FRAMES_PER_ISO_BUF * - ISO_BUF_COUNT, ttusb->iso_buffer, - ttusb->iso_dma_handle); + kfree(ttusb->iso_buffer); } 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__);