Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2202360lqo; Mon, 13 May 2024 10:38:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWGXPalVx5hmiKQBa0njud33LrsNojp/Gw93Kmg5yFv4fS3F/ABwUOoWpGuPtZTo/xmQzbW0tZxfR3s9hNLwU7LnuzI/ymqXu9eexgO9g== X-Google-Smtp-Source: AGHT+IGlvc+FP5gWyrOJoWOF7CvP8MQ4OfsEcGUkt7OEQw/eic7BO6NooyHesPBK8llUp4Am+DMx X-Received: by 2002:a05:6214:3c8f:b0:6a0:b014:c880 with SMTP id 6a1803df08f44-6a1679a7624mr184190566d6.29.1715621918057; Mon, 13 May 2024 10:38:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715621918; cv=pass; d=google.com; s=arc-20160816; b=N92hVjbhuh6bD6OM1j5SxwkMIzbMusqL8dEgBMNgtiLlopW2piCCQexp+8u+Ga9NkV VeoAIRfIvV+Z402AMrH+BY4zq7UQlpWxUajqrq3P4F+XZRDf+VQTxRtmtJl5nXJpM0VL zJN5qd7KysXTC9X36Vfc42ys6zvaj9I7c4a6qGCt/17dtGvL+jBjbkmPSSn5hUGX643y xt5LHzDVkiHOzroMwt53cSIeb9+5VVEX1GuOx+wVER6X6DCvN0W7GYin+pPwXSicZ8od nhNVFadHyP8AYpEh0oKjOifq0vV1CdAu2BzioK+Hwxl8xfIFXSxBeeJzCel2asErI/aR 02IQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=tArMz3CXGARffdI7GxCeEXs4RlHzAXyCNuBRtNfPV0w=; fh=ixb9tRM5/LVfnyDulMcHSMAQJBjHgXrp+JTesKorGNc=; b=KtwxuvWYMjLMcbO2hD1vzqnuoITonkgEYXUtqQgAntshzFq35k6OSXGnzG9/TNJ2eY /inFlrucM5D0VQYPCj7Ycl+lIIeU90R2rPdIpa6sOdnoSRWXiQNUk+XV+hbFm9KvdKHT JYz1tZzgRoQiOeNWuy4Hs5ofm90T6BTbJyVyVrCDU3Y0NWHY2FNGfOIQQrRl25skCvYG DCu9PY+QZYEBbZ4h3LFf8lu3fKDMqyb1z3T2mxkpQKtB+3OM0bQz13YWYbEPS8lrlE/+ /xyTwdCxeFxug+iHM0Mb9OygZukdRaQ5Fst8XxavxzWtZnN5uyAi50UK0qwi7B22FcGZ nMDw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=XWQayaUl; arc=pass (i=1 spf=pass spfdomain=wanadoo.fr dkim=pass dkdomain=wanadoo.fr dmarc=pass fromdomain=wanadoo.fr); spf=pass (google.com: domain of linux-kernel+bounces-177922-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177922-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=wanadoo.fr Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6a15f30ba36si101438306d6.608.2024.05.13.10.38.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 May 2024 10:38:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-177922-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=XWQayaUl; arc=pass (i=1 spf=pass spfdomain=wanadoo.fr dkim=pass dkdomain=wanadoo.fr dmarc=pass fromdomain=wanadoo.fr); spf=pass (google.com: domain of linux-kernel+bounces-177922-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177922-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=wanadoo.fr Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id BB0281C20AF7 for ; Mon, 13 May 2024 17:38:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0ACCC39FF3; Mon, 13 May 2024 17:37:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="XWQayaUl" Received: from smtp.smtpout.orange.fr (smtp-24.smtpout.orange.fr [80.12.242.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 80305339A1; Mon, 13 May 2024 17:37:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.12.242.24 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715621873; cv=none; b=vA1nW6LYEPTK5nmDKHHwu7jAsO+p+lo57Bj/dPegaYOYU2S3N7Mw93sgimB/wNt0f5UtxrONdCqf+PfV5Pms+tearZlMpTenH9+twMsOyKCRhIBLdbZJeUDRYcE1j2vq4d8AgKgdLAJw586lwM9byVhb/yRwuXti7KUQvNg8/bw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715621873; c=relaxed/simple; bh=5NI70CwdCr6ds3UXpAse5bSY/w2S2qX7EJ/03/SHaBA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hjRdjKEGl0Yn7G1XSpPD45ac9hcn6GL2i9cqwZsWkiPm6MQMSb5JmnfuBxNl6Nb4GpOXYA5cy6BO59fo4bThQILth/bFZwUq4VpHg8XTjOrTKPumAaLaxK1VnQXQm6HS35+tZPXtWsdu2EgviNS/hHTd5StZrcpiaUZY0aWQ3MA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr; spf=pass smtp.mailfrom=wanadoo.fr; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b=XWQayaUl; arc=none smtp.client-ip=80.12.242.24 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wanadoo.fr Received: from localhost.localdomain ([86.243.17.157]) by smtp.orange.fr with ESMTPA id 6ZcDs0lh7ME2z6ZcNsL821; Mon, 13 May 2024 19:37:44 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1715621864; bh=tArMz3CXGARffdI7GxCeEXs4RlHzAXyCNuBRtNfPV0w=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=XWQayaUl7WTsSQ5YM4kr8gQgm3qMIo2et81SM55AGN8EHTknUjJSUpj7xQgEorIfj DZZKp+bwgM9AZ1sZbI6vdNeIVUpfeq1TdYFqCuAWrzGTfnHxSIndH6ykKyqmx49ZQv jRWlYChvnRad263+ngdk3IM+02SqNMmSmYz3vyvVxVuCrDCQpDf9O3vLAk/xsZHCBE RbH2p5/tC5iwGfuJTqWO7WMCcAHiX6jS4LxkAiu6mEWGSJJa2G9U/td4xAI46ONVCA UrqCRtoobwviGkpEGdSt3fdbiEQjYrRa/2NJOCX/8pR6OioW5xKWtQTRE8S1h0ngfF 0PWWuO4oLY+KQ== X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Mon, 13 May 2024 19:37:44 +0200 X-ME-IP: 86.243.17.157 From: Christophe JAILLET To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, cezary.rojewski@intel.com, pierre-louis.bossart@linux.intel.com, peter.ujfalusi@linux.intel.com, yung-chuan.liao@linux.intel.com, ranjani.sridharan@linux.intel.com, kai.vehmanen@linux.intel.com, srinivas.kandagatla@linaro.org, bgoswami@quicinc.com, daniel.baluta@nxp.com Cc: linux-sound@vger.kernel.org, alsa-devel@alsa-project.org, sound-open-firmware@alsa-project.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH 5/6] ASoC: SOF: topology: Constify struct snd_soc_tplg_ops Date: Mon, 13 May 2024 19:37:24 +0200 Message-ID: <2d9f5b75e979eb38b6f3baf85dfa1f0fdb3447ef.1715526069.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.45.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Constifying "struct snd_soc_tplg_ops" 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 44519 2888 48 47455 b95f sound/soc/sof/topology.o After: text data bss dec hex filename 44839 2552 48 47439 b94f sound/soc/sof/topology.o Signed-off-by: Christophe JAILLET --- Compile tested-only. --- sound/soc/sof/topology.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c index da182314aa87..b54382131991 100644 --- a/sound/soc/sof/topology.c +++ b/sound/soc/sof/topology.c @@ -2278,7 +2278,7 @@ static const struct snd_soc_tplg_bytes_ext_ops sof_bytes_ext_ops[] = { {SOF_TPLG_KCTL_BYTES_VOLATILE_RO, snd_sof_bytes_ext_volatile_get}, }; -static struct snd_soc_tplg_ops sof_tplg_ops = { +static const struct snd_soc_tplg_ops sof_tplg_ops = { /* external kcontrol init - used for any driver specific init */ .control_load = sof_control_load, .control_unload = sof_control_unload, @@ -2433,7 +2433,7 @@ static int sof_dspless_link_load(struct snd_soc_component *scomp, int index, return 0; } -static struct snd_soc_tplg_ops sof_dspless_tplg_ops = { +static const struct snd_soc_tplg_ops sof_dspless_tplg_ops = { /* external widget init - used for any driver specific init */ .widget_ready = sof_dspless_widget_ready, .widget_unload = sof_dspless_widget_unload, -- 2.45.0