The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH 00/14] constify asoc snd_soc_dai_ops structures
@ 2017-08-18 12:05 Arvind Yadav
  2017-08-18 12:05 ` [PATCH 01/14] ASoC: blackfin: constify " Arvind Yadav
                   ` (13 more replies)
  0 siblings, 14 replies; 23+ messages in thread
From: Arvind Yadav @ 2017-08-18 12:05 UTC (permalink / raw)
  To: bardliao, oder_chiou, timur, lgirdwood, broonie; +Cc: linux-kernel, alsa-devel

snd_soc_dai_ops are not supposed to change at runtime. All functions
working with snd_soc_dai_ops provided by <sound/soc-dai.h> work with
const snd_soc_dai_ops. So mark the non-const structs as const.

Arvind Yadav (14):
  [PATCH 01/14] ASoC: blackfin: constify snd_soc_dai_ops structures
  [PATCH 02/14] ASoC: codecs: constify snd_soc_dai_ops structures
  [PATCH 03/14] ASoC: dwc: constify snd_soc_dai_ops structures
  [PATCH 04/14] ASoC: fsl: constify snd_soc_dai_ops structures
  [PATCH 05/14] ASoC: hisilicon: constify snd_soc_dai_ops structures
  [PATCH 06/14] ASoC: intel: constify snd_soc_dai_ops structures
  [PATCH 07/14] ASoC: mediatek: constify snd_soc_dai_ops structures
  [PATCH 08/14] ASoC: pxa: constify snd_soc_dai_ops structures
  [PATCH 09/14] ASoC: rockchip: constify snd_soc_dai_ops structures
  [PATCH 10/14] ASoC: spear: constify snd_soc_dai_ops structures
  [PATCH 11/14] ASoC: sunxi: constify snd_soc_dai_ops structures
  [PATCH 12/14] ASoC: tegra: constify snd_soc_dai_ops structures
  [PATCH 13/14] ASoC: ux500: constify snd_soc_dai_ops structures
  [PATCH 14/14] ASoC: zte: constify snd_soc_dai_ops structures

 sound/soc/blackfin/bf6xx-i2s.c               | 2 +-
 sound/soc/codecs/cs42l42.c                   | 2 +-
 sound/soc/codecs/es8316.c                    | 2 +-
 sound/soc/codecs/hdac_hdmi.c                 | 2 +-
 sound/soc/codecs/inno_rk3036.c               | 2 +-
 sound/soc/codecs/max9867.c                   | 2 +-
 sound/soc/codecs/max98926.c                  | 2 +-
 sound/soc/codecs/msm8916-wcd-analog.c        | 2 +-
 sound/soc/codecs/msm8916-wcd-digital.c       | 2 +-
 sound/soc/codecs/rt5616.c                    | 2 +-
 sound/soc/codecs/rt5663.c                    | 2 +-
 sound/soc/codecs/tas5720.c                   | 2 +-
 sound/soc/codecs/zx_aud96p22.c               | 2 +-
 sound/soc/dwc/dwc-i2s.c                      | 2 +-
 sound/soc/fsl/fsl_asrc.c                     | 2 +-
 sound/soc/fsl/fsl_esai.c                     | 2 +-
 sound/soc/fsl/fsl_spdif.c                    | 2 +-
 sound/soc/hisilicon/hi6210-i2s.c             | 2 +-
 sound/soc/intel/atom/sst-mfld-platform-pcm.c | 6 +++---
 sound/soc/intel/skylake/skl-pcm.c            | 8 ++++----
 sound/soc/mediatek/mt2701/mt2701-afe-pcm.c   | 2 +-
 sound/soc/pxa/mmp-sspa.c                     | 2 +-
 sound/soc/rockchip/rockchip_pdm.c            | 2 +-
 sound/soc/spear/spdif_in.c                   | 2 +-
 sound/soc/sunxi/sun8i-codec.c                | 2 +-
 sound/soc/tegra/tegra30_i2s.c                | 2 +-
 sound/soc/ux500/ux500_msp_dai.c              | 2 +-
 sound/soc/zte/zx-i2s.c                       | 2 +-
 sound/soc/zte/zx-spdif.c                     | 2 +-
 sound/soc/zte/zx-tdm.c                       | 2 +-
 30 files changed, 35 insertions(+), 35 deletions(-)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 23+ messages in thread
* [PATCH 3/3] ASoC: codecs: constify snd_soc_dai_ops structures
@ 2018-10-27 13:34 Julia Lawall
  2018-11-05 11:58 ` Applied "ASoC: codecs: constify snd_soc_dai_ops structures" to the asoc tree Mark Brown
  0 siblings, 1 reply; 23+ messages in thread
From: Julia Lawall @ 2018-10-27 13:34 UTC (permalink / raw)
  To: Liam Girdwood
  Cc: kernel-janitors, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	alsa-devel, linux-kernel

The snd_soc_dai_ops structures are only stored in the ops field of a
snd_soc_dai_driver structure, so make the snd_soc_dai_ops structures
const as well.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 sound/soc/codecs/ak4458.c   |    2 +-
 sound/soc/codecs/ak5558.c   |    2 +-
 sound/soc/codecs/hdac_hda.c |    2 +-
 sound/soc/codecs/tas6424.c  |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/sound/soc/codecs/ak4458.c b/sound/soc/codecs/ak4458.c
index 299ada4dfaa0..70d4c89bd6fc 100644
--- a/sound/soc/codecs/ak4458.c
+++ b/sound/soc/codecs/ak4458.c
@@ -456,7 +456,7 @@ static int ak4458_startup(struct snd_pcm_substream *substream,
 	return ret;
 }
 
-static struct snd_soc_dai_ops ak4458_dai_ops = {
+static const struct snd_soc_dai_ops ak4458_dai_ops = {
 	.startup        = ak4458_startup,
 	.hw_params	= ak4458_hw_params,
 	.set_fmt	= ak4458_set_dai_fmt,
diff --git a/sound/soc/codecs/ak5558.c b/sound/soc/codecs/ak5558.c
index 448bb90c9c8e..60f1f12c81ea 100644
--- a/sound/soc/codecs/ak5558.c
+++ b/sound/soc/codecs/ak5558.c
@@ -246,7 +246,7 @@ static int ak5558_startup(struct snd_pcm_substream *substream,
 					  &ak5558_rate_constraints);
 }
 
-static struct snd_soc_dai_ops ak5558_dai_ops = {
+static const struct snd_soc_dai_ops ak5558_dai_ops = {
 	.startup        = ak5558_startup,
 	.hw_params	= ak5558_hw_params,
 
diff --git a/sound/soc/codecs/hdac_hda.c b/sound/soc/codecs/hdac_hda.c
index 2aaa83028e55..ffecdaaa8cf2 100644
--- a/sound/soc/codecs/hdac_hda.c
+++ b/sound/soc/codecs/hdac_hda.c
@@ -46,7 +46,7 @@ static int hdac_hda_dai_set_tdm_slot(struct snd_soc_dai *dai,
 static struct hda_pcm *snd_soc_find_pcm_from_dai(struct hdac_hda_priv *hda_pvt,
 						 struct snd_soc_dai *dai);
 
-static struct snd_soc_dai_ops hdac_hda_dai_ops = {
+static const struct snd_soc_dai_ops hdac_hda_dai_ops = {
 	.startup = hdac_hda_dai_open,
 	.shutdown = hdac_hda_dai_close,
 	.prepare = hdac_hda_dai_prepare,
diff --git a/sound/soc/codecs/tas6424.c b/sound/soc/codecs/tas6424.c
index 36aebdb8f55c..aaba39295079 100644
--- a/sound/soc/codecs/tas6424.c
+++ b/sound/soc/codecs/tas6424.c
@@ -378,7 +378,7 @@ static struct snd_soc_component_driver soc_codec_dev_tas6424 = {
 	.non_legacy_dai_naming	= 1,
 };
 
-static struct snd_soc_dai_ops tas6424_speaker_dai_ops = {
+static const struct snd_soc_dai_ops tas6424_speaker_dai_ops = {
 	.hw_params	= tas6424_hw_params,
 	.set_fmt	= tas6424_set_dai_fmt,
 	.set_tdm_slot	= tas6424_set_dai_tdm_slot,


^ permalink raw reply related	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2018-11-05 11:58 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-18 12:05 [PATCH 00/14] constify asoc snd_soc_dai_ops structures Arvind Yadav
2017-08-18 12:05 ` [PATCH 01/14] ASoC: blackfin: constify " Arvind Yadav
2017-08-18 12:17   ` Mark Brown
2017-08-18 12:05 ` [PATCH 02/14] ASoC: codecs: " Arvind Yadav
2017-08-18 12:16   ` Mark Brown
2017-08-18 12:25   ` Applied "ASoC: codecs: constify snd_soc_dai_ops structures" to the asoc tree Mark Brown
2017-08-18 12:06 ` [PATCH 03/14] ASoC: dwc: constify snd_soc_dai_ops structures Arvind Yadav
2017-08-18 12:18   ` Mark Brown
2017-08-18 12:06 ` [PATCH 04/14] ASoC: fsl: " Arvind Yadav
2017-08-18 12:19   ` Mark Brown
2017-08-18 12:06 ` [PATCH 05/14] ASoC: hisilicon: " Arvind Yadav
2017-08-18 12:20   ` Mark Brown
2017-08-18 12:06 ` [PATCH 06/14] ASoC: intel: " Arvind Yadav
2017-08-18 12:06 ` [PATCH 07/14] ASoC: mediatek: " Arvind Yadav
2017-08-18 12:06 ` [PATCH 08/14] ASoC: pxa: " Arvind Yadav
2017-08-18 12:06 ` [PATCH 09/14] ASoC: rockchip: " Arvind Yadav
2017-08-18 12:06 ` [PATCH 10/14] ASoC: spear: " Arvind Yadav
2017-08-18 12:06 ` [PATCH 11/14] ASoC: sunxi: " Arvind Yadav
2017-08-18 12:06 ` [PATCH 12/14] ASoC: tegra: " Arvind Yadav
2017-08-18 12:06 ` [PATCH 13/14] ASoC: ux500: " Arvind Yadav
2017-08-18 12:25   ` Applied "ASoC: ux500: constify snd_soc_dai_ops structures" to the asoc tree Mark Brown
2017-08-18 12:06 ` [PATCH 14/14] ASoC: zte: constify snd_soc_dai_ops structures Arvind Yadav
  -- strict thread matches above, loose matches on Subject: below --
2018-10-27 13:34 [PATCH 3/3] ASoC: codecs: " Julia Lawall
2018-11-05 11:58 ` Applied "ASoC: codecs: constify snd_soc_dai_ops structures" to the asoc tree Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox