Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1492122imu; Sat, 8 Dec 2018 00:46:27 -0800 (PST) X-Google-Smtp-Source: AFSGD/W8JG8RSbRjttDmoBlsQHEWkGHNUNKxP0yPgDrS6yD/5mlr24UyvVai1JSSJQ7aZS85Dhtk X-Received: by 2002:a63:63c3:: with SMTP id x186mr4581007pgb.330.1544258787501; Sat, 08 Dec 2018 00:46:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544258787; cv=none; d=google.com; s=arc-20160816; b=jYgIO0EsRTWVnq7feQGM1+BTKuTy+hkchFjaEVYaDnWKnSx3oDKtloqGNhQfMxDs55 aMirMfqPi8ewefHrnjA4Hs57rLtdOMYa9wl+NqG/v6vj+6x7M8GcQ6qL7ZCR0qO9SG/5 +F0PjcxoVkH/ph25IBTUdV2dO6D8e+Unxu+NUu7qdZYv5uHM2sRfp+cO2oA4MBF9VDYw H+EnfWEgwMgu4RTUE7j4mXFw4TD+y/PvmjKfoFc/QYp+UWYHc2bNdOnLQNo3J/51VmkN pm9iNRhom6GtGhduqMVdmRnr2NAsfVKIHbEZeaz+ik+bUAELDlZxaOX2KuzS0QUW6m1M kBlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=I+pz6UZdK0K6mgyxN46l1j9os5TvEf4tvWIlUHsA0L4=; b=jjhsv7GqptgXjRqj7/dMJouzjCd2shgNLvzJfrYWkXT8Aybv/MUDZfT4IHD3qSxQNZ beA9aX2hFYeKlOJX+kqV6zxPEYUAz9iYLFLtCJUtbDt5sCqWUMqphMf4wZEQBH2TYqcT MYcHDPCQaIFBqIaC182VCIkx70xdPqDfVmVk98lEzCBUmqFQ81MTHufiFUV38991DRaI 3rKL5+jAtNr7K0y1V4QMU+oRMJPm5RLnssd9easSBEs+4xI824pbTweVfzpM4z1eqB3F AY0EqH5DXtoVm0wk7chxnNBGiRxVUBKnReI0HSlVfgUA3kQLB1gg4NsG3zj8Rn/x0I1w dN2g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u6si4825867plz.220.2018.12.08.00.46.11; Sat, 08 Dec 2018 00:46:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726413AbeLHIoV (ORCPT + 99 others); Sat, 8 Dec 2018 03:44:21 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:22221 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726357AbeLHIoV (ORCPT ); Sat, 8 Dec 2018 03:44:21 -0500 X-UUID: 0aaa5edce04e4e7886ff7a7167474148-20181208 X-UUID: 0aaa5edce04e4e7886ff7a7167474148-20181208 Received: from mtkcas08.mediatek.inc [(172.21.101.126)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1385563464; Sat, 08 Dec 2018 16:44:10 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs03n1.mediatek.inc (172.21.101.181) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Sat, 8 Dec 2018 16:44:08 +0800 Received: from localhost.localdomain (10.17.3.153) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Sat, 8 Dec 2018 16:44:07 +0800 From: Yong Wu To: Joerg Roedel , Matthias Brugger , Robin Murphy , Rob Herring CC: Tomasz Figa , Will Deacon , , , , , , , , , , , Nicolas Boichat , Arvind Yadav Subject: [PATCH v4 17/18] iommu/mediatek: Constify iommu_ops Date: Sat, 8 Dec 2018 16:39:30 +0800 Message-ID: <1544258371-4600-18-git-send-email-yong.wu@mediatek.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1544258371-4600-1-git-send-email-yong.wu@mediatek.com> References: <1544258371-4600-1-git-send-email-yong.wu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arvind Yadav iommu_ops are not supposed to change at runtime. Functions 'iommu_device_set_ops' and 'bus_set_iommu' working with const iommu_ops provided by . So mark the non-const structs as const. Signed-off-by: Arvind Yadav Signed-off-by: Yong Wu [Yong: Change the title to iommu/mediatek: xx] --- drivers/iommu/mtk_iommu.c | 4 ++-- drivers/iommu/mtk_iommu_v1.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index 9280031..03f5eee 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -119,7 +119,7 @@ struct mtk_iommu_domain { struct iommu_domain domain; }; -static struct iommu_ops mtk_iommu_ops; +static const struct iommu_ops mtk_iommu_ops; static LIST_HEAD(m4ulist); /* List all the M4U HWs */ @@ -503,7 +503,7 @@ static int mtk_iommu_of_xlate(struct device *dev, struct of_phandle_args *args) return iommu_fwspec_add_ids(dev, args->args, 1); } -static struct iommu_ops mtk_iommu_ops = { +static const struct iommu_ops mtk_iommu_ops = { .domain_alloc = mtk_iommu_domain_alloc, .domain_free = mtk_iommu_domain_free, .attach_dev = mtk_iommu_attach_device, diff --git a/drivers/iommu/mtk_iommu_v1.c b/drivers/iommu/mtk_iommu_v1.c index 6d4551e..5fbf3ce 100644 --- a/drivers/iommu/mtk_iommu_v1.c +++ b/drivers/iommu/mtk_iommu_v1.c @@ -364,7 +364,7 @@ static phys_addr_t mtk_iommu_iova_to_phys(struct iommu_domain *domain, return pa; } -static struct iommu_ops mtk_iommu_ops; +static const struct iommu_ops mtk_iommu_ops; /* * MTK generation one iommu HW only support one iommu domain, and all the client @@ -526,7 +526,7 @@ static int mtk_iommu_hw_init(const struct mtk_iommu_data *data) return 0; } -static struct iommu_ops mtk_iommu_ops = { +static const struct iommu_ops mtk_iommu_ops = { .domain_alloc = mtk_iommu_domain_alloc, .domain_free = mtk_iommu_domain_free, .attach_dev = mtk_iommu_attach_device, -- 1.9.1