Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3001582pxb; Fri, 12 Feb 2021 06:56:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJzneVlzY8D5ksXQItj5HfqNBSqtFjy/q7nEehMbTdwJwAJL2ArJXUfZ6EXjYUzJGu2Mqd95 X-Received: by 2002:a17:906:b752:: with SMTP id fx18mr3533309ejb.17.1613141801124; Fri, 12 Feb 2021 06:56:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613141801; cv=none; d=google.com; s=arc-20160816; b=g2K6Itzf3F63F4fgyeLfogB2t6D1o+f2WBCy8ubGCeRzfHzWaie20FCwYAeWH8PL3/ tmo4d9FvTqkUxjwuOwXg+6DugK+aKLinI7WwTGPvlyicyEqdGm5/tqfU+/CpX6mbda7u vELm5wv29IEH9pZpiO4Cq5Toxs/iob8CWEGjuT9JMgIzU018tcosc+GY5qANBSLmUpuz WgGQniktOIiznsyiGiRrMU+DnW4nQl6ZRHScDbRF/3oK6ziPmiVpUm/stI2uHmRPMqz5 My5MXJBMIx7vG6r3DvR0LOcsjkFHlZVwkQ5s3qoTszDlUVJvb9pcs/aQHIfP05FJiojE D2+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:message-id:date:thread-index :thread-topic:subject:cc:to:from; bh=QdPZxXDbfKXFkx+55LA2fdzufDkJEW4Znh77xIzkslc=; b=ysx+FRetQuAwkLfI0/eHi5DxyABOR4Z5HKg8PDaaisC/y0tawkrYn3BVPrR0NaHyTq P5CfEevFtS00fL2qv/Gp6Ny4SM5BVoE5jUfwYsGODBzwKqHd+FPy0rKrLMoBTfrV0lta m1x9WDpd5RQ8IO0JNvC/+2JUTpBPYooeEemkge8pb97vnHm33hqR4LQ0bzITevyTrjat zdrVp42Q0XXoxqPR0YPBxs/OZreneFOSrPEOJuQ1u6upfORPZ9YHiUwi5cX6cu3tQzsi nxBUGbGcj3YN7vnVnNYBh8lefh1+aOdqvlaw3YdSLi4PYqU2/0msudnIYD+Rm94rA05+ kwMA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cz11si6128925edb.175.2021.02.12.06.56.14; Fri, 12 Feb 2021 06:56:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229611AbhBLOzg (ORCPT + 99 others); Fri, 12 Feb 2021 09:55:36 -0500 Received: from szxga08-in.huawei.com ([45.249.212.255]:2838 "EHLO szxga08-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229478AbhBLOzf (ORCPT ); Fri, 12 Feb 2021 09:55:35 -0500 Received: from DGGEMM402-HUB.china.huawei.com (unknown [172.30.72.55]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4Dcc0v27n9z13t1L; Fri, 12 Feb 2021 22:52:31 +0800 (CST) Received: from dggemm752-chm.china.huawei.com (10.1.198.58) by DGGEMM402-HUB.china.huawei.com (10.3.20.210) with Microsoft SMTP Server (TLS) id 14.3.498.0; Fri, 12 Feb 2021 22:54:50 +0800 Received: from lhreml710-chm.china.huawei.com (10.201.108.61) by dggemm752-chm.china.huawei.com (10.1.198.58) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Fri, 12 Feb 2021 22:54:49 +0800 Received: from lhreml710-chm.china.huawei.com ([169.254.81.184]) by lhreml710-chm.china.huawei.com ([169.254.81.184]) with mapi id 15.01.2106.006; Fri, 12 Feb 2021 14:54:47 +0000 From: Shameerali Kolothum Thodi To: "linux-kernel@vger.kernel.org" , "iommu@lists.linux-foundation.org" CC: "joro@8bytes.org" , "robin.murphy@arm.com" , "jean-philippe@linaro.org" , "will@kernel.org" , "Zengtao (B)" , "linuxarm@openeuler.org" Subject: RE: [PATCH v2] iommu: Check dev->iommu in iommu_dev_xxx functions Thread-Topic: [PATCH v2] iommu: Check dev->iommu in iommu_dev_xxx functions Thread-Index: AdcBTrfjz4ngs6VWSn6F9Rp3qrl5mQ== Date: Fri, 12 Feb 2021 14:54:47 +0000 Message-ID: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.47.89.255] Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org SGkgUm9iaW4vSm9lcmcsDQoNCj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gRnJvbTog U2hhbWVlciBLb2xvdGh1bSBbbWFpbHRvOnNoYW1lZXJhbGkua29sb3RodW0udGhvZGlAaHVhd2Vp LmNvbV0NCj4gU2VudDogMDEgRmVicnVhcnkgMjAyMSAxMjo0MQ0KPiBUbzogbGludXgta2VybmVs QHZnZXIua2VybmVsLm9yZzsgaW9tbXVAbGlzdHMubGludXgtZm91bmRhdGlvbi5vcmcNCj4gQ2M6 IGpvcm9AOGJ5dGVzLm9yZzsgcm9iaW4ubXVycGh5QGFybS5jb207IGplYW4tcGhpbGlwcGVAbGlu YXJvLm9yZzsNCj4gd2lsbEBrZXJuZWwub3JnOyBaZW5ndGFvIChCKSA8cHJpbWUuemVuZ0BoaXNp bGljb24uY29tPjsNCj4gbGludXhhcm1Ab3BlbmV1bGVyLm9yZw0KPiBTdWJq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