From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1E710C33CAF for ; Sun, 19 Jan 2020 22:18:52 +0000 (UTC) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (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 D86B820678 for ; Sun, 19 Jan 2020 22:18:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D86B820678 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 87F0A1FE65; Sun, 19 Jan 2020 22:18:51 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KUZhOSRNOsA4; Sun, 19 Jan 2020 22:18:50 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by silver.osuosl.org (Postfix) with ESMTP id CD14C2001A; Sun, 19 Jan 2020 22:18:50 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id C0B16C0176; Sun, 19 Jan 2020 22:18:50 +0000 (UTC) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id DCBACC0174 for ; Sun, 19 Jan 2020 22:18:49 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id C39152001A for ; Sun, 19 Jan 2020 22:18:49 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sKJselucDkO4 for ; Sun, 19 Jan 2020 22:18:48 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by silver.osuosl.org (Postfix) with ESMTPS id 6B1C41FE65 for ; Sun, 19 Jan 2020 22:18:48 +0000 (UTC) Received: by verein.lst.de (Postfix, from userid 2407) id 8E9FB68B20; Sun, 19 Jan 2020 23:18:43 +0100 (CET) Date: Sun, 19 Jan 2020 23:18:43 +0100 From: Christoph Hellwig To: Jon Derrick Subject: Re: [PATCH v4 4/7] iommu/vt-d: Use pci_real_dma_dev() for mapping Message-ID: <20200119221843.GA4759@lst.de> References: <1579278449-174098-1-git-send-email-jonathan.derrick@intel.com> <1579278449-174098-5-git-send-email-jonathan.derrick@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1579278449-174098-5-git-send-email-jonathan.derrick@intel.com> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: linux-pci@vger.kernel.org, iommu@lists.linux-foundation.org, Bjorn Helgaas , Keith Busch , David Woodhouse , Christoph Hellwig X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" On Fri, Jan 17, 2020 at 09:27:26AM -0700, Jon Derrick wrote: > + if (dev_is_pci(dev)) { > + struct pci_dev *pdev; > + > + pdev = pci_real_dma_dev(to_pci_dev(dev)); > + dev = &pdev->dev; I think this could be simplified to if (dev_is_pci(dev)) dev = &pci_real_dma_dev(to_pci_dev(dev)->dev; _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu