From patchwork Sat Dec 4 22:33:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rikard Falkeborn X-Patchwork-Id: 12694804 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 29513C433EF for ; Sat, 4 Dec 2021 22:34:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :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=haRe+yH7JoPLgJdg8c3iVgdmpOWMx+RdV1rHqzF7iwc=; b=x4rjxZ9g4gQbYq pQytlRrx5sqzR8qAm+j0HXWS729Je+RWZyxIOFV2tachhnXGofsxgBpHw0G0lf2WBpR+Qrv/qa0wX plAW1mjoFg23Qp7S7Y1NQNLX+RWjTz6kCbYMKYRplSkZp1cS4DBqDqU2rel4UbLD+m6rJE3+6lYhP 6RRKK6bTvxDASBIqq1ObkAnbCkRpcX6kLmCFLTKKsINTj0R25qwDBau7jjjNjnyP8u1GqZojPD20j AZP69jcPgfGrjokaFl8LI3dLtUOMI+vqdB8jtmfWfL1iel7LQMaszhU+06QjVh/DnQe+pm/qv4cij qHEr/Q1400m4CdCRFU4g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mtdaj-000wmW-5t; Sat, 04 Dec 2021 22:33:13 +0000 Received: from mail-lj1-x229.google.com ([2a00:1450:4864:20::229]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mtdaf-000wls-Gw for linux-arm-kernel@lists.infradead.org; Sat, 04 Dec 2021 22:33:10 +0000 Received: by mail-lj1-x229.google.com with SMTP id z8so13323465ljz.9 for ; Sat, 04 Dec 2021 14:33:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=JcR/1TkvkZEzS/XW2AKnFEClRR66tq7M2hycKAeV9lk=; b=qyVf/zAn7iCw2B5P/SI7zem1gA4GDvMO8nsQdDYe0OhvMrS0sp3V8eVaWv2JvJFUKD 9DTRSHVWIP8AycZZMu/lzhppacy6YDwbCKOVEuc1PdndsoOctwvb5UABLpwf3OA7PvkI RjTFhUUNTdEh4UuxJ0zEzwYHWT0k6wBS1ry1IDG6xSLpgif16vqVuhvCImbm6hRoZwsr dQaQ1tsoDNHwtVk2VaFV2FS+Sko4ti3psW+lHOwwXWGg0SWSyaD6o0QPwG1/fYjbES3Z HZWmpQMDqJcwlv65Z0t2iIwlxmGGkx5ePlzvj4IO2bI1VSRjJr0lX2qPlH+uPdjwncMj uKXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=JcR/1TkvkZEzS/XW2AKnFEClRR66tq7M2hycKAeV9lk=; b=WNMOlnXaudi+Ju4nWi7S7sNSabG3PuJOq728wsaQZZz5775LB7uK9syNwjWyM5zpDq jGq3cbO5mB8SKLCoVGqpbxHw2RrtwrvKvuytIUhahIAPYzDNoPOt3j0HL3IJ+yd1XGfm WD3gS7mVam3RRaAjKpfdnQkjD4aU1u3nL0Pc/sm91vnJpefOOcxNK49at8s4ZrD8KnhO /zpO+vgeXhS2UYk7iAo0HTn/q/fpyFWhIppqdwJZy85j/TCpANeQg4rrAE+zRVnsmBOb jOQNKkiLsqpXBGAuLhcvR/xlUe3nH1TqhFCeYvEGAEK6Ov7CAW5ECUV6+EJy6El77RNl V4aA== X-Gm-Message-State: AOAM532zbPs1jjhD/OJAmF5OzutKkBwK63jMCSFD2n6tyKowkUwx7OfR AcJbatrOb5tU56WcnuwwfVk= X-Google-Smtp-Source: ABdhPJxDC9IzaaRdBdaUhhcLV9tTL5ss7E0UuFEqJAXk8UPPOqTIYFZ5WD9J93rz8GwUd8Ek6nJgng== X-Received: by 2002:a2e:b711:: with SMTP id j17mr27964564ljo.39.1638657186996; Sat, 04 Dec 2021 14:33:06 -0800 (PST) Received: from localhost.localdomain (h-155-4-221-129.NA.cust.bahnhof.se. [155.4.221.129]) by smtp.gmail.com with ESMTPSA id h1sm886834lfp.249.2021.12.04.14.33.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Dec 2021 14:33:06 -0800 (PST) From: Rikard Falkeborn To: Will Deacon , Robin Murphy , Joerg Roedel Cc: Jonathan Cameron , Jean-Philippe Brucker , Eric Auger , linux-arm-kernel@lists.infradead.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Rikard Falkeborn Subject: [PATCH] iommu/arm-smmu-v3: Constify arm_smmu_mmu_notifier_ops Date: Sat, 4 Dec 2021 23:33:01 +0100 Message-Id: <20211204223301.100649-1-rikard.falkeborn@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211204_143309_599180_886E6D54 X-CRM114-Status: GOOD ( 12.94 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The only usage of arm_smmu_mmu_notifier_ops is to assign its address to the ops field in the mmu_notifier struct, which is a pointer to const struct mmu_notifier_ops. Make it const to allow the compiler to put it in read-only memory. Signed-off-by: Rikard Falkeborn Reviewed-by: Jean-Philippe Brucker --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-sva.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-sva.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-sva.c index ee66d1f4cb81..a737ba5f727e 100644 --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-sva.c +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-sva.c @@ -220,7 +220,7 @@ static void arm_smmu_mmu_notifier_free(struct mmu_notifier *mn) kfree(mn_to_smmu(mn)); } -static struct mmu_notifier_ops arm_smmu_mmu_notifier_ops = { +static const struct mmu_notifier_ops arm_smmu_mmu_notifier_ops = { .invalidate_range = arm_smmu_mm_invalidate_range, .release = arm_smmu_mm_release, .free_notifier = arm_smmu_mmu_notifier_free,