From nobody Mon Feb 9 10:52:01 2026 Received: from smtp.smtpout.orange.fr (smtp-21.smtpout.orange.fr [80.12.242.21]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 05C4E286D56; Mon, 3 Nov 2025 06:33:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.12.242.21 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762151603; cv=none; b=FW3sn+LUn0Hder9Xg6m4dYKXWiKKefnHeNXLTAYLHLJrq6MTGIiJNQnqDenQrNoc4lHIJz8P8zAcZl/zbB39XtWDnMA3H6ZQP/NqrlL5oS8uWxhaHv6Dgzbfv9BXQy3HesRsELZhWA0opwvXc8Hxv58kJFn+pVeF1MiaRlDS7+k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762151603; c=relaxed/simple; bh=0Nbk7N6TuGG8DqeUUT+1/buN8Uf1W+rXtEdV71vyM0k=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=uWT6FXn9ezrtNW/YNFZeR1IQoLqHDrNQBQNls6rb62YuePpq+C46T4i7SsshEL41Io9KgpN5vJ+sU7bGTaU9/PUT9RUdNIM1LuVCCUX775HveIwCgVbwNkovXfAq6qGxPc0W7CAG0Obd4h4FxvfFEylJ/Lopz2tHMjE44NRl4PQ= 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=lLTFZU36; arc=none smtp.client-ip=80.12.242.21 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="lLTFZU36" Received: from fedora.home ([IPv6:2a01:cb10:785:b00:8347:f260:7456:7662]) by smtp.orange.fr with ESMTPA id Fo6ovtBvMsL0VFo6pvhfqx; Mon, 03 Nov 2025 07:32:08 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1762151528; bh=AXuQEY3AagyS51O+lVG4zaIuniqmVZG13dgoQRqEHxA=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=lLTFZU36FYB0sKQyFImDYg0x8kfglP8EUdMvpX22mTojxO3tFK3caMU/oiUty2jgO kIU+K9GQdAjC1Y42Lreqn7cTd3hDfmtZR8lvFMGrrfFtorC6cyjZwUbEswloGoinjf gOtnnQQkH8KXBiPlrQAvLPybrYotWwgRVBSP3vNvDGnoBO4/em1NEwvEqk0jx7KJ1G EPugLS+Qlley1Ylz/XLOnCCAnl+VpBo1ho38+kLM9R2hRX9xxd0135mYwqbJIk2TU9 cex59Yo2hDoQw+2TvTzDrqCfYHHaqIotJ/7PcqX7umepfUHMFyznUupg9QpcbTHNON fsnF4qh0nMHyQ== X-ME-Helo: fedora.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Mon, 03 Nov 2025 07:32:08 +0100 X-ME-IP: 2a01:cb10:785:b00:8347:f260:7456:7662 From: Christophe JAILLET To: Shengjiu Wang , Xiubo Li , Fabio Estevam , Nicolin Chen , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-sound@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: [PATCH] ASoC: fsl_spdif: Constify some structures Date: Mon, 3 Nov 2025 07:32:03 +0100 Message-ID: <5fe08f028395a6c6f50d11eee8fdb4a90b1f68ab.1762151503.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.51.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 'struct fsl_spdif_soc_data' and 'struct snd_kcontrol_new' are not modified in this driver. Constifying these structures moves some data to a read-only section, so increases overall security, especially when the structure holds some function pointers. On a x86_64, with allmodconfig: Before: =3D=3D=3D=3D=3D=3D text data bss dec hex filename 53548 25576 128 79252 13594 sound/soc/fsl/fsl_spdif.o After: =3D=3D=3D=3D=3D text data bss dec hex filename 54828 24296 128 79252 13594 sound/soc/fsl/fsl_spdif.o Signed-off-by: Christophe JAILLET --- sound/soc/fsl/fsl_spdif.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sound/soc/fsl/fsl_spdif.c b/sound/soc/fsl/fsl_spdif.c index ee946e0d3f49..1b9be85b34c2 100644 --- a/sound/soc/fsl/fsl_spdif.c +++ b/sound/soc/fsl/fsl_spdif.c @@ -148,7 +148,7 @@ struct fsl_spdif_priv { struct clk *pll11k_clk; }; =20 -static struct fsl_spdif_soc_data fsl_spdif_vf610 =3D { +static const struct fsl_spdif_soc_data fsl_spdif_vf610 =3D { .imx =3D false, .shared_root_clock =3D false, .raw_capture_mode =3D false, @@ -158,7 +158,7 @@ static struct fsl_spdif_soc_data fsl_spdif_vf610 =3D { .tx_formats =3D FSL_SPDIF_FORMATS_PLAYBACK, }; =20 -static struct fsl_spdif_soc_data fsl_spdif_imx35 =3D { +static const struct fsl_spdif_soc_data fsl_spdif_imx35 =3D { .imx =3D true, .shared_root_clock =3D false, .raw_capture_mode =3D false, @@ -168,7 +168,7 @@ static struct fsl_spdif_soc_data fsl_spdif_imx35 =3D { .tx_formats =3D FSL_SPDIF_FORMATS_PLAYBACK, }; =20 -static struct fsl_spdif_soc_data fsl_spdif_imx6sx =3D { +static const struct fsl_spdif_soc_data fsl_spdif_imx6sx =3D { .imx =3D true, .shared_root_clock =3D true, .raw_capture_mode =3D false, @@ -179,7 +179,7 @@ static struct fsl_spdif_soc_data fsl_spdif_imx6sx =3D { =20 }; =20 -static struct fsl_spdif_soc_data fsl_spdif_imx8qm =3D { +static const struct fsl_spdif_soc_data fsl_spdif_imx8qm =3D { .imx =3D true, .shared_root_clock =3D true, .raw_capture_mode =3D false, @@ -189,7 +189,7 @@ static struct fsl_spdif_soc_data fsl_spdif_imx8qm =3D { .tx_formats =3D SNDRV_PCM_FMTBIT_S24_LE, /* Applied for EDMA */ }; =20 -static struct fsl_spdif_soc_data fsl_spdif_imx8mm =3D { +static const struct fsl_spdif_soc_data fsl_spdif_imx8mm =3D { .imx =3D true, .shared_root_clock =3D false, .raw_capture_mode =3D true, @@ -199,7 +199,7 @@ static struct fsl_spdif_soc_data fsl_spdif_imx8mm =3D { .tx_formats =3D FSL_SPDIF_FORMATS_PLAYBACK, }; =20 -static struct fsl_spdif_soc_data fsl_spdif_imx8ulp =3D { +static const struct fsl_spdif_soc_data fsl_spdif_imx8ulp =3D { .imx =3D true, .shared_root_clock =3D true, .raw_capture_mode =3D false, @@ -1146,7 +1146,7 @@ static int fsl_spdif_usync_put(struct snd_kcontrol *k= control, } =20 /* FSL SPDIF IEC958 controller defines */ -static struct snd_kcontrol_new fsl_spdif_ctrls[] =3D { +static const struct snd_kcontrol_new fsl_spdif_ctrls[] =3D { /* Status cchanel controller */ { .iface =3D SNDRV_CTL_ELEM_IFACE_MIXER, @@ -1233,7 +1233,7 @@ static struct snd_kcontrol_new fsl_spdif_ctrls[] =3D { }, }; =20 -static struct snd_kcontrol_new fsl_spdif_ctrls_rcm[] =3D { +static const struct snd_kcontrol_new fsl_spdif_ctrls_rcm[] =3D { { .iface =3D SNDRV_CTL_ELEM_IFACE_PCM, .name =3D "IEC958 Raw Capture Mode", --=20 2.51.1