From patchwork Mon Aug 28 12:12:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 9925413 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2BBD960329 for ; Mon, 28 Aug 2017 12:22:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0A4EB286C1 for ; Mon, 28 Aug 2017 12:22:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F1317286CC; Mon, 28 Aug 2017 12:22:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8A345286C1 for ; Mon, 28 Aug 2017 12:22:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=64m6VydTAvZ1Fsvr9b6+RoM6erkKRJmT8pc+34L62ng=; b=tmx AoI8rPGn/kgYu+z/zVr4a7a9US/9TxSsoGZHbfKf/mQoXXOS3HN1s7hDxBOEy6AwWxapMREVz5hon xiPXFTMFFcNK2Qc9fq1kicEs8Z2Fq3WqCi4acGvPCEIByq0FlHl1iFmrz1qqvyEw3hQN8T1yybkVd Vwh2JxGJqDLmKHSExmUFmZtl6o1CGglxKcLKwE1FmGlMRM6coIlk6wWve1ew8pQ2Yv1tLpCLzU1qr 2I+4ZwAx7RG16YfUUJsCIrkzB4pqZCvyzWR3XsT8xmoHq5v8u/Fm+E51nD3vPYZ9wkClD8i7AcZfG kvWt6eZDfh94YTOjeS2TlanQhX+0oGw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dmJ3A-0002BS-7M; Mon, 28 Aug 2017 12:21:52 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dmJ2e-0001pl-7w; Mon, 28 Aug 2017 12:21:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=asOgUP7UtoRtW9Y3bmMjc9Q/YMJYopYuGiZhZlWw4bg=; b=EsC9v8XN5SbpOavO3IxM9n/Tn JbHvX4FjG9df14eGcLkSULniK6J58hiYuaqqAMcQnmzBDn43VP8JNNMIsmP9fXUxQuNp/rLCu2J/h 8twda4OKf6S16vwLuGOIIBm6AfEu6QVX6u/N6aO6rH2c8MXbsmyKjddiAN0W5mDKqVHmXrVDHog7e dNkeIQjkekDLyON6b5rRs+PC2sFHpnfav3rlXmWjuLNkBJYx0CLGvhDHPL3hoU6XGIE7rmJQWfvOu lhdFI0udmfSMmmgmSVsRB9gZByLoyWMgt3tYRVBZvRuwBMc8ScCxtIr37Gx+SJmGDaBbFp/P/QxHk jXvMhEILw==; Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]) by casper.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dmIun-0007gg-8w; Mon, 28 Aug 2017 12:13:15 +0000 Received: by mail-pf0-x244.google.com with SMTP id g13so204052pfm.2; Mon, 28 Aug 2017 05:12:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=asOgUP7UtoRtW9Y3bmMjc9Q/YMJYopYuGiZhZlWw4bg=; b=Jm83RRmZNM4kah4C26WNnLlfvnPap6ihIDXO0RhKQp9Lt88iaqNANwCJ49MhJ2bXdO d7Rn1KButdgAG9ErL79kMYTJUP+KbNLFVWiO006oteLa5QAcI2kESW3M5oVohoePMfqo 4y3yMUtkeqOzHawOsTetbrVwaDlzFn9MfiQeTujCH9PJZi3YJzd6JvpelzbY60GIl48Y mmP7iMNGub1pheFa7eFN6AJBOXnOsQ2gkOibu5IBxhIRJl0lMZkobSZT8T6Oe12tM0Vo VfEPHSxXtTww58WCz4Gczq7rMpp3S92p85wo9IZwgaQt/U+Gb2jPfj2Nkw4a/VB9UFbV 1Epg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=asOgUP7UtoRtW9Y3bmMjc9Q/YMJYopYuGiZhZlWw4bg=; b=Nk9gy/ea/KuoAlZZXWUpxtz3ZbMYNHCFn6YpHtxKQqaC8PVpkWodvo/Sh0iGi9heew Q6wj34ocyfap4OZhsbLtk0rGXKQ1XIOXHFwnEj8V4yqnLo88JzihHIbvLxeVH5aEUus0 ejzD28LW7eecLJ7SWrDuQkWk9oc0R5fAFGYodBNuF+0UQyvmeJ8pbz44KLb2EkREakNd TYWCM2O9ldXdj/dVlsZlfv4zEzD4MAd8sKz2EKsbND6LHPnjaDwspCG5BWID/Nl5aqct ClgkdOXk2LPZNWRiVbr/2KU19meJmgRnr9Cb+hALjPqrnxkAffa/i8QM/oqZ92HkAUQW kLQA== X-Gm-Message-State: AHYfb5jwu3uZEpBqDHk8lcToeS6FeJa1VWMjyyJ/iReC/0P9aYG7OBvn RI4JlYrlmFEPGQ== X-Received: by 10.98.158.215 with SMTP id f84mr354592pfk.246.1503922371388; Mon, 28 Aug 2017 05:12:51 -0700 (PDT) Received: from symbol-HP-Z420-Workstation.zebra.lan ([223.31.70.102]) by smtp.googlemail.com with ESMTPSA id y70sm743883pfg.53.2017.08.28.05.12.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 28 Aug 2017 05:12:50 -0700 (PDT) From: Arvind Yadav To: m.szyprowski@samsung.com, joro@8bytes.org, kgene@kernel.org, krzk@kernel.org, matthias.bgg@gmail.com, gerald.schaefer@de.ibm.com Subject: [PATCH 2/3] iommu: mtk: constify iommu_ops Date: Mon, 28 Aug 2017 17:42:26 +0530 Message-Id: <1503922346-25947-1-git-send-email-arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170828_131313_512207_1243AF3C X-CRM114-Status: GOOD ( 12.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: iommu@lists.linux-foundation.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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 91c6d36..eac99a3 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -102,7 +102,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 struct mtk_iommu_domain *to_mtk_domain(struct iommu_domain *dom) { @@ -437,7 +437,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 bc1efbf..40b231f 100644 --- a/drivers/iommu/mtk_iommu_v1.c +++ b/drivers/iommu/mtk_iommu_v1.c @@ -363,7 +363,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 @@ -536,7 +536,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,