From patchwork Thu Sep 17 17:32:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 11783173 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D807E746 for ; Thu, 17 Sep 2020 17:41:28 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9757320872 for ; Thu, 17 Sep 2020 17:41:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="FoipS6J4"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="W52KmyKf" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9757320872 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=4hXiF7W2mQ1CIKMbbwzCGNNI0g11vvRDCYzA1N6k4f8=; b=FoipS6J4aCE/iLy7j0nb75UGK fZp0gBy06w0aMLZ3HEjciCGHHYYcU9o09bKbEv+JSqvjkDIi6qCpbUbUr/q50H0bI5dGeDbkff5ZC KbP0QH5vBxQIrqLQY7m00iaea4KNLlqWWTftlrzX4YC3aeS9lFXe3LWWLVGt00jqjXpCB26jX7xUT mZuz7VqJLWp6CWn/1NVhbdwHQQ/Ye3xLFyMXkK7m7BpRAEpD8paXCpdEek07F6cUg8lL9xITGJuM/ xcVTcsbylIo+gMfZJgMQrBFXBnJ1ByOD9ItgShd7gBRnaQa+vIyX1Y9CHtFXgW/8b+vcADSdlI8Up uGUhepRTQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kIxuH-00080D-3T; Thu, 17 Sep 2020 17:41:17 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kIxuE-0007zQ-V6 for linux-arm-kernel@merlin.infradead.org; Thu, 17 Sep 2020 17:41:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=KzFlskTtmrM7XbM2RHeFq/XrvDOcZp5iQ+zvN+xoZ6s=; b=W52KmyKfz6Yg3D0Gg5sOUVRhY6 9YO2fXcc15UC2+ZB2tB1a0OE4cfo9DsFWP7/dS743uyXakYRhS1KIY3opHGbxQt+iLIdF6wvt2WtP LLz0yp5vyGE6FTYHWtp4ORfhbFh7EO7JQPux3AS+/zCdT0F8/GUZmhaNyWdj4k6BRIwfnFewGpgKs nMrx6f3O+9pRsKF9wBuEEgVYdWEmAhrDe76OJoWf3L6mY3oyBVMyPt+zNlZaxqln9B5i+OgP3qbYF ZkRP5uQO5bM2XVOxbcPsz4RCDpxE0XOPeTJZPAYeOBc+Oder4glvi+mKRSlECAkvSONOV8ILHN1Xk TAnZT62Q==; Received: from 089144214092.atnat0023.highway.a1.net ([89.144.214.92] helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kIxuD-0003Ny-D8; Thu, 17 Sep 2020 17:41:13 +0000 From: Christoph Hellwig To: Russell King Subject: [PATCH 3/4] ARM/dma-mapping: don't handle NULL devices in dma-direct.h Date: Thu, 17 Sep 2020 19:32:28 +0200 Message-Id: <20200917173229.3311382-4-hch@lst.de> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200917173229.3311382-1-hch@lst.de> References: <20200917173229.3311382-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Aaro Koskinen , Tony Lindgren , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, linux-omap@vger.kernel.org, Robin Murphy , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The DMA API removed support for not passing in a device a long time ago, so remove the NULL checks. Signed-off-by: Christoph Hellwig --- arch/arm/include/asm/dma-direct.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/arch/arm/include/asm/dma-direct.h b/arch/arm/include/asm/dma-direct.h index 1f04a5e1c615de..84cb4e30658891 100644 --- a/arch/arm/include/asm/dma-direct.h +++ b/arch/arm/include/asm/dma-direct.h @@ -11,7 +11,7 @@ */ static inline dma_addr_t pfn_to_dma(struct device *dev, unsigned long pfn) { - if (dev && dev->dma_range_map) + if (dev->dma_range_map) pfn = PFN_DOWN(translate_phys_to_dma(dev, PFN_PHYS(pfn))); return (dma_addr_t)__pfn_to_phys(pfn); } @@ -20,16 +20,13 @@ static inline unsigned long dma_to_pfn(struct device *dev, dma_addr_t addr) { unsigned long pfn = __phys_to_pfn(addr); - if (dev && dev->dma_range_map) + if (dev->dma_range_map) pfn = PFN_DOWN(translate_dma_to_phys(dev, PFN_PHYS(pfn))); return pfn; } static inline dma_addr_t virt_to_dma(struct device *dev, void *addr) { - if (dev) - return pfn_to_dma(dev, virt_to_pfn(addr)); - return (dma_addr_t)__virt_to_bus((unsigned long)(addr)); }