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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88713C433F5 for ; Wed, 9 Feb 2022 06:45:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232753AbiBIGpD (ORCPT ); Wed, 9 Feb 2022 01:45:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234225AbiBIGou (ORCPT ); Wed, 9 Feb 2022 01:44:50 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37FDFC03544F for ; Tue, 8 Feb 2022 22:44:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=KmU/3ByFFqL6kVhZO8U+qtBb64MZx4iPb69sQBmFw9s=; b=YWQ1mpOyWmMiA4wGtaJ8yjU7nA EzGaeGfEP8xZFRlvZCqQG+8MneA5I1MWrbwEKwVbf56z434AKyBfUxDT0oB2rqJCB0P7Niv/KTcOF GRcNJ8eT2JXcH1Nmb9N0MfL8H3NbrU4WPZm4+wYs9qOoKEAM6q16a5t3JyrjkXLf9pFmsaVx4b55u c6xcl8NEVs8gbCYHE6BtLFqr78EYama5WrGK5b0oC8jo8C6YqG1XCMVfZoDUklhYgy398GANW1Sx/ iXtY1taObbswNfyi70UiF+eM+5s2wKhHVMl1y2wahUaiOX428w1qyREnuz4LvLE8gLoo/vXl9uhNA aSZxa1+g==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nHgic-00GNnQ-UI; Wed, 09 Feb 2022 06:44:46 +0000 Date: Tue, 8 Feb 2022 22:44:46 -0800 From: Christoph Hellwig To: Lu Baolu Cc: Joerg Roedel , Jason Gunthorpe , Christoph Hellwig , Ben Skeggs , Kevin Tian , Ashok Raj , Will Deacon , Robin Murphy , Alex Williamson , Eric Auger , Liu Yi L , Jacob jun Pan , David Airlie , Daniel Vetter , Thierry Reding , Jonathan Hunter , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 09/10] iommu: Use dev_iommu_ops() helper Message-ID: References: <20220208012559.1121729-1-baolu.lu@linux.intel.com> <20220208012559.1121729-10-baolu.lu@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220208012559.1121729-10-baolu.lu@linux.intel.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 08, 2022 at 09:25:58AM +0800, Lu Baolu wrote: > Convert all the feasible instances of dev->bus->iommu_ops to > dev_iommu_ops() in order to making the operation of obtaining > iommu_ops from a device consistent. I'm not a native speaker, but I think this should read ".. in order to make .." > void iommu_get_resv_regions(struct device *dev, struct list_head *list) > { > - const struct iommu_ops *ops = dev->bus->iommu_ops; > + const struct iommu_ops *ops = dev_iommu_ops(dev); > > if (ops && ops->get_resv_regions) dev_iommu_ops warns on a NULL ops, so we either don'tneed the ops check here or have another problem. Same in a few more spots.