From patchwork Sun Jun 23 15:15:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 806900 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (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 647B6C27C4F for ; Sun, 23 Jun 2024 15:16:04 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id D7B23950; Sun, 23 Jun 2024 17:15:52 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D7B23950 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1719155762; bh=VTtHoMRrh/CknLnrTiA6cISWe0B7QIazQmbA5Bs4n5g=; h=From:To:Cc:Subject:Date:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=GRoxipZAw7nzBz3WLdDlAmTPz44NEf91soZg6fLJSYr5QlK3E8npnwV/4TTTVvEoA dQo53P9K17Bz8ufYwWKohzTO0/by8ZIIwqcLUPJLgSvQqlMdMVDaq4vaf+q0NJ1YZU Z5i+rpXbw5NAB25vA3K5gH7RTux3t5gE3ttZLx2c= Received: by alsa1.perex.cz (Postfix, from userid 50401) id E5D4EF805B0; Sun, 23 Jun 2024 17:15:30 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id A30A4F805B5; Sun, 23 Jun 2024 17:15:30 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D9990F80495; Sun, 23 Jun 2024 17:15:25 +0200 (CEST) Received: from msa.smtpout.orange.fr (msa-211.smtpout.orange.fr [193.252.23.211]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 15CD9F800E4 for ; Sun, 23 Jun 2024 17:15:19 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 15CD9F800E4 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=wanadoo.fr header.i=@wanadoo.fr header.a=rsa-sha256 header.s=t20230301 header.b=QCd1Vmfi Received: from fedora.home ([86.243.222.230]) by smtp.orange.fr with ESMTPA id LOvzs9RlN2GQtLOvzsbDUH; Sun, 23 Jun 2024 17:15:19 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1719155719; bh=6xc2xyXmsrpTItWg6IptTdpN90W19e46SCweNrwd4z4=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=QCd1Vmfi7/8s3qsK8bcJq1V3dXy73L7NZiNWiMW2h/YlojSzlRfWprMCDw3ibhUk2 W6vX3VEQsVlKfW1edVOsjY6V/EhNgQNszuWZH/BS9yyRwaR5+yQ93jQIHmSm/+j79y YOoAdA2eMSBy5sq7mRbob3AguiMoy95CsrbLvgDwD7u4z4DKAAaxq2diqhomNZoN+H eQ8JcyJ128zs2PY923RLqCPMgGbdeBEKLbcGAyV8G5PIc4fQuPgO7zgICNwhoFv+jv 6muz8tudmTkaRTOLabI5bXCM2DXdgFRef7pHsEL4PUEvn7CllwapiA6mL99TA6Z+dZ N798nWjA/7hPw== X-ME-Helo: fedora.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 23 Jun 2024 17:15:19 +0200 X-ME-IP: 86.243.222.230 From: Christophe JAILLET To: Cezary Rojewski , Pierre-Louis Bossart , Liam Girdwood , Peter Ujfalusi , Bard Liao , Ranjani Sridharan , Kai Vehmanen , Mark Brown , Jaroslav Kysela , Takashi Iwai Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , alsa-devel@alsa-project.org, linux-sound@vger.kernel.org Subject: [PATCH] ASoC: Intel: sst: Constify struct intel_sst_ops Date: Sun, 23 Jun 2024 17:15:11 +0200 Message-ID: <098acdf266b2f4a922d6a624e9032ec24a09093c.1719155688.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 Message-ID-Hash: AVRDRDRRLNEQD4JLHIK6F6HQGS2QCL5K X-Message-ID-Hash: AVRDRDRRLNEQD4JLHIK6F6HQGS2QCL5K X-MailFrom: christophe.jaillet@wanadoo.fr X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 'struct intel_sst_ops' is not modified in this driver. 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 12250 1000 112 13362 3432 sound/soc/intel/atom/sst/sst.o After: ===== text data bss dec hex filename 12378 888 112 13378 3442 sound/soc/intel/atom/sst/sst.o Signed-off-by: Christophe JAILLET --- Compile tested-only --- sound/soc/intel/atom/sst/sst.c | 2 +- sound/soc/intel/atom/sst/sst.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/intel/atom/sst/sst.c b/sound/soc/intel/atom/sst/sst.c index e0357d257c6c..ff03fde12151 100644 --- a/sound/soc/intel/atom/sst/sst.c +++ b/sound/soc/intel/atom/sst/sst.c @@ -158,7 +158,7 @@ static int sst_save_dsp_context_v2(struct intel_sst_drv *sst) } -static struct intel_sst_ops mrfld_ops = { +static const struct intel_sst_ops mrfld_ops = { .interrupt = intel_sst_interrupt_mrfld, .irq_thread = intel_sst_irq_thread_mrfld, .clear_interrupt = intel_sst_clear_intr_mrfld, diff --git a/sound/soc/intel/atom/sst/sst.h b/sound/soc/intel/atom/sst/sst.h index 126903e126e4..e0db7434543c 100644 --- a/sound/soc/intel/atom/sst/sst.h +++ b/sound/soc/intel/atom/sst/sst.h @@ -391,7 +391,7 @@ struct intel_sst_drv { unsigned int csr_value; void *fw_in_mem; struct sst_sg_list fw_sg_list, library_list; - struct intel_sst_ops *ops; + const struct intel_sst_ops *ops; struct sst_info info; struct pm_qos_request *qos; unsigned int use_dma;