From patchwork Sun Jun 23 16:11:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13708674 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 E7E72C27C4F for ; Sun, 23 Jun 2024 16:12:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=kaFvdfIOWtupjnAleAY1qcroO+ccHQ2tdJGDcVUeyB0=; b=Bp7KSbUTi/uW9zShURHOxQw9+I I29f5Bt4OCBWdk+dVFD5q9UN5vl2MCrg+ROQjZbMv7udoNZD3szyePncSPCCo+TaWLnw9sbIAb+4f iBvDI0ZRQtvFC1nGcpYF58/ndzwgATqr8r7TgYg4EShek67c89cz0TTd3q5WFaNHUx0rpaHouywtV wd7lQCSTGbNaPijrogZOVQDYqixN1vPDIfJrmxYWkccKPsrNM1uAOS3FOkXEZBtNEY5RgZAVr9vsr HRGz4ZEuQFP8znyAWAnDqmt4qEB7ci9LB0sfO316emyUT7yNcoT6lTgOUY3TkP4mukR07dRoNVwVT H8dHzKDQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sLPoo-0000000ELzy-3vkf; Sun, 23 Jun 2024 16:11:54 +0000 Received: from out-12.smtpout.orange.fr ([193.252.22.12] helo=out.smtpout.orange.fr) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sLPoi-0000000ELyi-3oRd for linux-arm-kernel@lists.infradead.org; Sun, 23 Jun 2024 16:11:50 +0000 Received: from fedora.home ([86.243.222.230]) by smtp.orange.fr with ESMTPA id LPoWsaLbz6H4sLPoWsNZPd; Sun, 23 Jun 2024 18:11:38 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1719159098; bh=kaFvdfIOWtupjnAleAY1qcroO+ccHQ2tdJGDcVUeyB0=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=bvT+Orc4k44jsLDJdXNh9di3qYYz2iZG95kO6AFtXPVRP0jgZbnTB6le6kqgh8K0T mhSgBTM48vToFcXd22PzCMYvqcSONs3n+VjLbjBAVfAXfClWLn+/dhx1GeVC2T86YA E3hZZPlwiqdhdLaafvnlA8yXIwty7+dWFH9EcAKz1ICQaubHZeWb2VqpoMKFe4Eoir UBeT9UrUo+nk35l3AwxWnmImdtvgno63xaj5gL9UXgXt5JjFMlCPUcbGG5I/ZVShgo mWyGCojLFSKmdme3D14LrdT6Mqv8Z8zj5Us4wuVXiuSt+1kNkcS+QC7wnp8ZzFnebV ux/yAlzkbgZpg== X-ME-Helo: fedora.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 23 Jun 2024 18:11:38 +0200 X-ME-IP: 86.243.222.230 From: Christophe JAILLET To: Nishanth Menon , Santosh Shilimkar Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-arm-kernel@lists.infradead.org Subject: [PATCH] soc: ti: knav_qmss: Constify struct knav_range_ops Date: Sun, 23 Jun 2024 18:11:31 +0200 Message-ID: X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240623_091149_133879_624DED6B X-CRM114-Status: GOOD ( 11.39 ) 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 'struct knav_range_ops' is not modified in these drivers. Constifying this structure moves some data to a read-only section, so increase overall security. On a x86_64, with allmodconfig: Before: ====== text data bss dec hex filename 7498 1193 0 8691 21f3 drivers/soc/ti/knav_qmss_acc.o After: ===== text data bss dec hex filename 7566 1145 0 8711 2207 drivers/soc/ti/knav_qmss_acc.o Signed-off-by: Christophe JAILLET --- Compile tested-only --- drivers/soc/ti/knav_qmss.h | 2 +- drivers/soc/ti/knav_qmss_acc.c | 2 +- drivers/soc/ti/knav_qmss_queue.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/soc/ti/knav_qmss.h b/drivers/soc/ti/knav_qmss.h index a01eda720bf6..9325e8ce2e25 100644 --- a/drivers/soc/ti/knav_qmss.h +++ b/drivers/soc/ti/knav_qmss.h @@ -333,7 +333,7 @@ struct knav_range_info { void *queue_base_inst; unsigned flags; struct list_head list; - struct knav_range_ops *ops; + const struct knav_range_ops *ops; struct knav_acc_info acc_info; struct knav_acc_channel *acc; unsigned num_irqs; diff --git a/drivers/soc/ti/knav_qmss_acc.c b/drivers/soc/ti/knav_qmss_acc.c index 3d388646ed43..269b4e75ae40 100644 --- a/drivers/soc/ti/knav_qmss_acc.c +++ b/drivers/soc/ti/knav_qmss_acc.c @@ -450,7 +450,7 @@ static int knav_acc_free_range(struct knav_range_info *range) return 0; } -static struct knav_range_ops knav_acc_range_ops = { +static const struct knav_range_ops knav_acc_range_ops = { .set_notify = knav_acc_set_notify, .init_queue = knav_acc_init_queue, .open_queue = knav_acc_open_queue, diff --git a/drivers/soc/ti/knav_qmss_queue.c b/drivers/soc/ti/knav_qmss_queue.c index 06fb5505c22c..f2055a76f84c 100644 --- a/drivers/soc/ti/knav_qmss_queue.c +++ b/drivers/soc/ti/knav_qmss_queue.c @@ -411,7 +411,7 @@ static int knav_gp_close_queue(struct knav_range_info *range, return 0; } -static struct knav_range_ops knav_gp_range_ops = { +static const struct knav_range_ops knav_gp_range_ops = { .set_notify = knav_gp_set_notify, .open_queue = knav_gp_open_queue, .close_queue = knav_gp_close_queue,