Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4353858pxk; Wed, 30 Sep 2020 00:13:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwi9gVC40UshpDE8OIYZqA0vF4blDsAdFpf6F46g3Hdj0oR8/F7eqgfPG1QPOpJPjXTkvBV X-Received: by 2002:a05:6402:1697:: with SMTP id a23mr1231211edv.195.1601450008974; Wed, 30 Sep 2020 00:13:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601450008; cv=none; d=google.com; s=arc-20160816; b=ix0l1TMHOqKgolQwo4XcU08hy/DlHCsDoWqQj+udPCtjJq54SEmsAe5iUgMy9eWx33 j9Y/jhuqkNv6GXMiavL/H2PTCxVsL83bjdKneQr93/mAHh6BZNaf2ZwFxq72b5UHAxUN edph4P34GJnGv0klRN4UitF/sa+4/jjiTsmisdNnmg/oSqA3CSk0NUccjR5zwROvPyOD uOfbK8ISjfKhRr1kYXellYrz4Zpwhg6gejJ1GOJnpwH46UTwVXlsrXtXrB99CIsEKnXz edWJEjq8EADFZjyN+Js1op1rIcwgG/hR84gYmtQFMgqehxREEhp3wt9zWVZcNyVxbJu4 uTKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Ht9Ptwuk+VuT5pGxeJtwDjNx+t30frJY68IPwImwxUI=; b=M912gYop9KtKCthTo67vzuCX+BYUwmkFSAWNNcos+2tsv30GrU87sMOaraijYicZ6M OnDPmv/7FYfOFM8PYiGR600Fv5pdSD+9qAAx/kLWtgUZ3Mu5lnms/x9P5XZwDo49U7/n HsWyICyfZMXsr2a0wryQA08+FylvW0DjcbjctOoIWzykTddZZCY5DOtTtaPNK0cu6cNG FxvOdBCyT8rnYAnsPVrNxCKqCAFU0BXCaCRgPhbM5LiF5C/wU7cwKbdVZ164MmnZ5Ih6 8SOXGtzFp1cJjceZ9VvxwAXidM/g1Gw95BlB5Ql25Xakx3WUT7OVRit8Qh84rOFInwhz 9rkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=NOPhqmnt; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p34si495996edb.470.2020.09.30.00.13.06; Wed, 30 Sep 2020 00:13:28 -0700 (PDT) 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; dkim=pass header.i=@mediatek.com header.s=dk header.b=NOPhqmnt; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728856AbgI3HL1 (ORCPT + 99 others); Wed, 30 Sep 2020 03:11:27 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:42269 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728471AbgI3HLZ (ORCPT ); Wed, 30 Sep 2020 03:11:25 -0400 X-UUID: 09b4bc92fe2641f79b65d22b5eafbfa9-20200930 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=Ht9Ptwuk+VuT5pGxeJtwDjNx+t30frJY68IPwImwxUI=; b=NOPhqmntzVcrrU6BkQ4i7VKdE1UHkLMwjwAZ4ZYRHq+8Xf7HPH1HPX5brsaqih5/jyoASWIEeQ/myR6+4RJogPZbqnWyC5n6lxY7EwzRS269j5QPo0IbN19BiLR+T1tbbR2icGb/vMPVEM0sk2Wi8vj+tuo1gLnVd7G/AhEz66c=; X-UUID: 09b4bc92fe2641f79b65d22b5eafbfa9-20200930 Received: from mtkexhb02.mediatek.inc [(172.21.101.103)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 195719789; Wed, 30 Sep 2020 15:11:22 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs08n2.mediatek.inc (172.21.101.56) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 30 Sep 2020 15:11:19 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 30 Sep 2020 15:11:19 +0800 From: Yong Wu To: Joerg Roedel , Matthias Brugger , Rob Herring , Robin Murphy , Krzysztof Kozlowski , Will Deacon CC: Evan Green , Tomasz Figa , , , , , , , , , Nicolas Boichat , , , , Greg Kroah-Hartman , Subject: [PATCH v3 22/24] iommu/mediatek: Adjust the structure Date: Wed, 30 Sep 2020 15:06:45 +0800 Message-ID: <20200930070647.10188-23-yong.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200930070647.10188-1-yong.wu@mediatek.com> References: <20200930070647.10188-1-yong.wu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: F82727C8988526C40468DBDD65B746E5881403CBBC44F2B14C30866F95997EEE2000:8 X-MTK: N Content-Transfer-Encoding: base64 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org QWRkICJzdHJ1Y3QgbXRrX2lvbW11X2RhdGEgKiIgaW4gdGhlICJzdHJ1Y3QgbXRrX2lvbW11X2Rv bWFpbiI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