Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1884098pxk; Sat, 5 Sep 2020 01:16:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy74ViNRKAmRlfHzhBPnmDdIlH6UnsAcU3Zo1snF9LUyTFSOD1LI3eul60A3cZb/oTNKzB1 X-Received: by 2002:a17:906:af42:: with SMTP id ly2mr10937809ejb.362.1599293778530; Sat, 05 Sep 2020 01:16:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599293778; cv=none; d=google.com; s=arc-20160816; b=oE82lvGXra6+Q40tSgoaDe/GnuouU90dE1vCANgwV5pbvMpLCMxvHF2104dViV8JG3 pFmEp61GYmLeBu6h5cF3kuqoDWox9iIqIsbX/gXlwCyCtmnvpxdKXOWDdVpsUkibCtgk CX7x+WOUJMmN1VVMrT9JVSI4S+o2NqgVMagwB03yjhg0csMDix5l+f37IZaCIE/p/tEg er6a34QW6NqWFw0+RwP1S33V/1O+dx5cQyD4+83lLuqy5o6bG3Vc4dEccPfZFPy2iQsK BGfQejoc4NTzdjHw0f2cN2R++S/fWWlqXdqAjJrpXvBPG4EvhtIb+DY3TIIIci0B75Bu UAlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=6QVE2iAMpSCY4zCW8o3NiNM6r6MmpAVDcSR8sc3Z1pI=; b=ET063N1BSu3qakKHcbtCDXduoVuxMQVi29aFBUvXWSxdxBblRIRCLUioWNj0Dqq2Jb 40D4gyhHZSkbIaG0hdLphbuzlOqWMEsK7PPefp03/ZjoukpghaRfxyOvzYhseF2+tHwK Z9SdjzLx5pjVPAb9ZWbFBCmaMDgTWyCHabIOSdv7CXU3MvFr9piQxv6s+29T0BdzBs3B +EpKYo0DsdsNR3J5siWtdL6/JYhnz2hlDuVH4WrmtgtXorlAUN1eoHfCGqXUHZtxwOBI EqTMbPKWoT/jnPOWN+NHlNbsJvXn6jMK3ZlDIlVFffw4Nn2Xjj0CJNY5pa4CNx3RQjtV kVTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b="FisUv8/5"; 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 ju7si3970527ejb.418.2020.09.05.01.15.55; Sat, 05 Sep 2020 01:16:18 -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="FisUv8/5"; 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 S1728379AbgIEIOq (ORCPT + 99 others); Sat, 5 Sep 2020 04:14:46 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:17454 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728591AbgIEIOi (ORCPT ); Sat, 5 Sep 2020 04:14:38 -0400 X-UUID: 9c8286f8ab834267856cd67458567241-20200905 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=6QVE2iAMpSCY4zCW8o3NiNM6r6MmpAVDcSR8sc3Z1pI=; b=FisUv8/5h6hznwZgDykUDge7v3Hhf2JBFGkLsUq3uHHN7Os1oOVmPK0oE/e9YL6J+LWBuzI9VLh3/08X27BMlT/B/KABCrWDO+4MLAKTkFfQNI8mMx/LqW5hb0B483+6WN+uDbrxX4CxFQtD6FpQlW8p08aZoZhztg9BN/aLkgA=; X-UUID: 9c8286f8ab834267856cd67458567241-20200905 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw01.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 291281488; Sat, 05 Sep 2020 16:14:34 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs08n1.mediatek.inc (172.21.101.55) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sat, 5 Sep 2020 16:14:31 +0800 Received: from localhost.localdomain (10.17.3.153) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Sat, 5 Sep 2020 16:14:31 +0800 From: Yong Wu To: Joerg Roedel , Matthias Brugger , Rob Herring , Robin Murphy CC: Will Deacon , Evan Green , Tomasz Figa , , , , , , , , , Nicolas Boichat , , , Subject: [PATCH v2 21/23] iommu/mediatek: Adjust the structure Date: Sat, 5 Sep 2020 16:09:18 +0800 Message-ID: <20200905080920.13396-22-yong.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200905080920.13396-1-yong.wu@mediatek.com> References: <20200905080920.13396-1-yong.wu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Content-Transfer-Encoding: base64 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org QWRkICJzdHJ1Y3QgbXRrX2lvbW11X2RhdGEgKiIgaW4gdGhlICJzdHJ1Y3QgbXRrX2lvbW11X2Rv bWFpbiIsDQpyZWR1Y2UgdGhlIGNhbGwgbXRrX2lvbW11X2dldF9tNHVfZGF0YSgpLg0KTm8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