[PATCH 0/3] ALSA: make snd_kcontrol_new const

2017-08-16 Thread Bhumika Goyal
Make these structures const. Done using Coccinelle.

Bhumika Goyal (3):
  ALSA: aoa: make snd_kcontrol_new const
  ALSA: pcxhr: make snd_kcontrol_new const
  ALSA: hda: make snd_kcontrol_new const

 sound/aoa/codecs/onyx.c| 12 ++--
 sound/pci/hda/patch_analog.c   |  4 ++--
 sound/pci/hda/patch_sigmatel.c |  2 +-
 sound/pci/pcxhr/pcxhr_mixer.c  |  4 ++--
 4 files changed, 11 insertions(+), 11 deletions(-)

-- 
1.9.1



[PATCH 1/3] ALSA: aoa: make snd_kcontrol_new const

2017-08-16 Thread Bhumika Goyal
Make these const as they are only used during a copy operation.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 sound/aoa/codecs/onyx.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/sound/aoa/codecs/onyx.c b/sound/aoa/codecs/onyx.c
index a04edff..d2d96ca 100644
--- a/sound/aoa/codecs/onyx.c
+++ b/sound/aoa/codecs/onyx.c
@@ -167,7 +167,7 @@ static int onyx_snd_vol_put(struct snd_kcontrol *kcontrol,
return 1;
 }
 
-static struct snd_kcontrol_new volume_control = {
+static const struct snd_kcontrol_new volume_control = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Master Playback Volume",
.access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
@@ -229,7 +229,7 @@ static int onyx_snd_inputgain_put(struct snd_kcontrol 
*kcontrol,
return n != v;
 }
 
-static struct snd_kcontrol_new inputgain_control = {
+static const struct snd_kcontrol_new inputgain_control = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Master Capture Volume",
.access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
@@ -284,7 +284,7 @@ static int onyx_snd_capture_source_put(struct snd_kcontrol 
*kcontrol,
return 1;
 }
 
-static struct snd_kcontrol_new capture_source_control = {
+static const struct snd_kcontrol_new capture_source_control = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
/* If we name this 'Input Source', it properly shows up in
 * alsamixer as a selection, * but it's shown under the
@@ -348,7 +348,7 @@ static int onyx_snd_mute_put(struct snd_kcontrol *kcontrol,
return !err ? (v != c) : err;
 }
 
-static struct snd_kcontrol_new mute_control = {
+static const struct snd_kcontrol_new mute_control = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Master Playback Switch",
.access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
@@ -476,7 +476,7 @@ static int onyx_spdif_mask_get(struct snd_kcontrol 
*kcontrol,
return 0;
 }
 
-static struct snd_kcontrol_new onyx_spdif_mask = {
+static const struct snd_kcontrol_new onyx_spdif_mask = {
.access =   SNDRV_CTL_ELEM_ACCESS_READ,
.iface =SNDRV_CTL_ELEM_IFACE_PCM,
.name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,CON_MASK),
@@ -533,7 +533,7 @@ static int onyx_spdif_put(struct snd_kcontrol *kcontrol,
return 1;
 }
 
-static struct snd_kcontrol_new onyx_spdif_ctrl = {
+static const struct snd_kcontrol_new onyx_spdif_ctrl = {
.access =   SNDRV_CTL_ELEM_ACCESS_READWRITE,
.iface =SNDRV_CTL_ELEM_IFACE_PCM,
.name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT),
-- 
1.9.1



[PATCH 2/3] ALSA: pcxhr: make snd_kcontrol_new const

2017-08-16 Thread Bhumika Goyal
Make these const as they are only used during a copy operation.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 sound/pci/pcxhr/pcxhr_mixer.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/pci/pcxhr/pcxhr_mixer.c b/sound/pci/pcxhr/pcxhr_mixer.c
index 36875df..d9a1c6c 100644
--- a/sound/pci/pcxhr/pcxhr_mixer.c
+++ b/sound/pci/pcxhr/pcxhr_mixer.c
@@ -185,7 +185,7 @@ static int pcxhr_analog_vol_put(struct snd_kcontrol 
*kcontrol,
return changed;
 }
 
-static struct snd_kcontrol_new pcxhr_control_analog_level = {
+static const struct snd_kcontrol_new pcxhr_control_analog_level = {
.iface =SNDRV_CTL_ELEM_IFACE_MIXER,
.access =   (SNDRV_CTL_ELEM_ACCESS_READWRITE |
 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
@@ -409,7 +409,7 @@ static int pcxhr_pcm_vol_put(struct snd_kcontrol *kcontrol,
return changed;
 }
 
-static struct snd_kcontrol_new snd_pcxhr_pcm_vol =
+static const struct snd_kcontrol_new snd_pcxhr_pcm_vol =
 {
.iface =SNDRV_CTL_ELEM_IFACE_MIXER,
.access =   (SNDRV_CTL_ELEM_ACCESS_READWRITE |
-- 
1.9.1



[PATCH 3/3] ALSA: hda: make snd_kcontrol_new const

2017-08-16 Thread Bhumika Goyal
Make these const as they are only passed as the 3rd argument to the
function snd_hda_gen_add_kctl, which is of type const.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 sound/pci/hda/patch_analog.c   | 4 ++--
 sound/pci/hda/patch_sigmatel.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
index e0fb8c6..7578573 100644
--- a/sound/pci/hda/patch_analog.c
+++ b/sound/pci/hda/patch_analog.c
@@ -505,7 +505,7 @@ static int ad1983_auto_smux_enum_put(struct snd_kcontrol 
*kcontrol,
return 1;
 }
 
-static struct snd_kcontrol_new ad1983_auto_smux_mixer = {
+static const struct snd_kcontrol_new ad1983_auto_smux_mixer = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "IEC958 Playback Source",
.info = ad1983_auto_smux_enum_info,
@@ -788,7 +788,7 @@ static int ad1988_auto_smux_enum_put(struct snd_kcontrol 
*kcontrol,
return 1;
 }
 
-static struct snd_kcontrol_new ad1988_auto_smux_mixer = {
+static const struct snd_kcontrol_new ad1988_auto_smux_mixer = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "IEC958 Playback Source",
.info = ad1988_auto_smux_enum_info,
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 6cefdf6..63d15b5 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -961,7 +961,7 @@ static int stac_smux_enum_put(struct snd_kcontrol *kcontrol,
 &spec->cur_smux[smux_idx]);
 }
 
-static struct snd_kcontrol_new stac_smux_mixer = {
+static const struct snd_kcontrol_new stac_smux_mixer = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "IEC958 Playback Source",
/* count set later */
-- 
1.9.1



[PATCH 0/2] [media]: make snd_kcontrol_new const

2017-08-16 Thread Bhumika Goyal
Make these const. Done using Coccinelle.

Bhumika Goyal (2):
  [media] cx88: make snd_kcontrol_new const
  [media] solo6x10: make snd_kcontrol_new const

 drivers/media/pci/cx88/cx88-alsa.c | 2 +-
 drivers/media/pci/solo6x10/solo6x10-g723.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

-- 
1.9.1



[PATCH 1/2] [media] cx88: make snd_kcontrol_new const

2017-08-16 Thread Bhumika Goyal
Make this const as it only passed as the 1st argument to the function
snd_ctl_new1, which is of type const.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 drivers/media/pci/cx88/cx88-alsa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/pci/cx88/cx88-alsa.c 
b/drivers/media/pci/cx88/cx88-alsa.c
index c81fe46..9740326 100644
--- a/drivers/media/pci/cx88/cx88-alsa.c
+++ b/drivers/media/pci/cx88/cx88-alsa.c
@@ -799,7 +799,7 @@ static int snd_cx88_alc_put(struct snd_kcontrol *kcontrol,
return 0;
 }
 
-static struct snd_kcontrol_new snd_cx88_alc_switch = {
+static const struct snd_kcontrol_new snd_cx88_alc_switch = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Line-In ALC Switch",
.info = snd_ctl_boolean_mono_info,
-- 
1.9.1



[PATCH 2/2] [media] solo6x10: make snd_kcontrol_new const

2017-08-16 Thread Bhumika Goyal
Make this const as it is only used during a copy operation.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 drivers/media/pci/solo6x10/solo6x10-g723.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/pci/solo6x10/solo6x10-g723.c 
b/drivers/media/pci/solo6x10/solo6x10-g723.c
index 3ca9470..81be1b8 100644
--- a/drivers/media/pci/solo6x10/solo6x10-g723.c
+++ b/drivers/media/pci/solo6x10/solo6x10-g723.c
@@ -319,7 +319,7 @@ static int snd_solo_capture_volume_put(struct snd_kcontrol 
*kcontrol,
return 1;
 }
 
-static struct snd_kcontrol_new snd_solo_capture_volume = {
+static const struct snd_kcontrol_new snd_solo_capture_volume = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Capture Volume",
.info = snd_solo_capture_volume_info,
-- 
1.9.1



[PATCH] ASoC: codecs: make snd_compr_ops const

2017-08-16 Thread Bhumika Goyal
Make these const as they are only stored in the compr_ops field of a
snd_soc_platform_driver structure, which is of type const.
Done using Coccinelle

Signed-off-by: Bhumika Goyal 
---
 sound/soc/codecs/cs47l24.c | 2 +-
 sound/soc/codecs/wm5102.c  | 2 +-
 sound/soc/codecs/wm5110.c  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/soc/codecs/cs47l24.c b/sound/soc/codecs/cs47l24.c
index 505dbc9..e09fc8f 100644
--- a/sound/soc/codecs/cs47l24.c
+++ b/sound/soc/codecs/cs47l24.c
@@ -1203,7 +1203,7 @@ static struct regmap *cs47l24_get_regmap(struct device 
*dev)
},
 };
 
-static struct snd_compr_ops cs47l24_compr_ops = {
+static const struct snd_compr_ops cs47l24_compr_ops = {
.open = cs47l24_open,
.free = wm_adsp_compr_free,
.set_params = wm_adsp_compr_set_params,
diff --git a/sound/soc/codecs/wm5102.c b/sound/soc/codecs/wm5102.c
index f500692..72486bf 100644
--- a/sound/soc/codecs/wm5102.c
+++ b/sound/soc/codecs/wm5102.c
@@ -2017,7 +2017,7 @@ static struct regmap *wm5102_get_regmap(struct device 
*dev)
},
 };
 
-static struct snd_compr_ops wm5102_compr_ops = {
+static const struct snd_compr_ops wm5102_compr_ops = {
.open = wm5102_open,
.free = wm_adsp_compr_free,
.set_params = wm_adsp_compr_set_params,
diff --git a/sound/soc/codecs/wm5110.c b/sound/soc/codecs/wm5110.c
index d6fae139..858a24f 100644
--- a/sound/soc/codecs/wm5110.c
+++ b/sound/soc/codecs/wm5110.c
@@ -2372,7 +2372,7 @@ static struct regmap *wm5110_get_regmap(struct device 
*dev)
},
 };
 
-static struct snd_compr_ops wm5110_compr_ops = {
+static const struct snd_compr_ops wm5110_compr_ops = {
.open = wm5110_open,
.free = wm_adsp_compr_free,
.set_params = wm_adsp_compr_set_params,
-- 
1.9.1



[PATCH] [media] cx18: Fix incompatible type for argument error

2017-08-16 Thread Bhumika Goyal
The first argument of function snd_ctl_new1 is of type const struct
snd_kcontrol_new * but in this file the variable is passed by value to
this function.
This generated ""incompatible type for argument" error. So, pass the
variable by reference.

Signed-off-by: Bhumika Goyal 
---
I was not able to compile this file and I could not find any reference to
this file in any Makefile. Also, I could not find any reference to 
anything defined in this file. That means the code is not used anywhere.
So, should I send a patch for removing the file?

 drivers/media/pci/cx18/cx18-alsa-mixer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/pci/cx18/cx18-alsa-mixer.c 
b/drivers/media/pci/cx18/cx18-alsa-mixer.c
index 06b066b..cb04c3d 100644
--- a/drivers/media/pci/cx18/cx18-alsa-mixer.c
+++ b/drivers/media/pci/cx18/cx18-alsa-mixer.c
@@ -161,7 +161,7 @@ int __init snd_cx18_mixer_create(struct snd_cx18_card *cxsc)
 
strlcpy(sc->mixername, "CX23418 Mixer", sizeof(sc->mixername));
 
-   ret = snd_ctl_add(sc, snd_ctl_new1(snd_cx18_mixer_tv_vol, cxsc));
+   ret = snd_ctl_add(sc, snd_ctl_new1(&snd_cx18_mixer_tv_vol, cxsc));
if (ret) {
CX18_ALSA_WARN("%s: failed to add %s control, err %d\n",
__func__, snd_cx18_mixer_tv_vol.name, ret);
-- 
1.9.1



[PATCH] [media] ivtv: Fix incompatible type for argument error

2017-08-16 Thread Bhumika Goyal
The first argument of function snd_ctl_new1 is of type const struct
snd_kcontrol_new * but in this file the variable is passed by value
to this function. This generated ""incompatible type for argument"
error. So, pass the variable by reference.

Signed-off-by: Bhumika Goyal 
---
I was not able to compile this file and I could not find any reference to
this file in any Makefile. Also, I could not find any reference to
anything defined in this file. That means the code is not used anywhere.
So, should I send a patch for removing the file?

 drivers/media/pci/ivtv/ivtv-alsa-mixer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/pci/ivtv/ivtv-alsa-mixer.c 
b/drivers/media/pci/ivtv/ivtv-alsa-mixer.c
index ba372a2..aee453f 100644
--- a/drivers/media/pci/ivtv/ivtv-alsa-mixer.c
+++ b/drivers/media/pci/ivtv/ivtv-alsa-mixer.c
@@ -156,7 +156,7 @@ int __init snd_ivtv_mixer_create(struct snd_ivtv_card 
*itvsc)
 
strlcpy(sc->mixername, "CX2341[56] Mixer", sizeof(sc->mixername));
 
-   ret = snd_ctl_add(sc, snd_ctl_new1(snd_ivtv_mixer_tv_vol, itvsc));
+   ret = snd_ctl_add(sc, snd_ctl_new1(&snd_ivtv_mixer_tv_vol, itvsc));
if (ret) {
IVTV_ALSA_WARN("%s: failed to add %s control, err %d\n",
   __func__, snd_ivtv_mixer_tv_vol.name, ret);
-- 
1.9.1



[PATCH 0/7] ASoC: make snd_soc_ops const

2017-08-16 Thread Bhumika Goyal
Make these const. Done using Coccinelle.

Bhumika Goyal (7):
  ASoC: aux1x: make snd_soc_ops const
  ASoC: cirrus: make snd_soc_ops const
  ASoC: generic: make snd_soc_ops const
  ASoC: pxa: make snd_soc_ops const
  ASoC: rockchip: make snd_soc_ops const
  ASoC: samsung: make snd_soc_ops const
  ASoC: sh: make snd_soc_ops const

 sound/soc/au1x/db1200.c  | 2 +-
 sound/soc/cirrus/edb93xx.c   | 2 +-
 sound/soc/cirrus/snappercl15.c   | 2 +-
 sound/soc/generic/audio-graph-card.c | 2 +-
 sound/soc/generic/audio-graph-scu-card.c | 2 +-
 sound/soc/pxa/raumfeld.c | 2 +-
 sound/soc/rockchip/rk3288_hdmi_analog.c  | 2 +-
 sound/soc/samsung/jive_wm8750.c  | 2 +-
 sound/soc/samsung/s3c24xx_simtec.c   | 2 +-
 sound/soc/samsung/s3c24xx_uda134x.c  | 2 +-
 sound/soc/samsung/smdk_spdif.c   | 2 +-
 sound/soc/sh/migor.c | 2 +-
 12 files changed, 12 insertions(+), 12 deletions(-)

-- 
1.9.1



[PATCH 1/7] ASoC: aux1x: make snd_soc_ops const

2017-08-16 Thread Bhumika Goyal
Make this const as it is only stored in the ops field of a
snd_soc_dai_link structure, which is const.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 sound/soc/au1x/db1200.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/au1x/db1200.c b/sound/soc/au1x/db1200.c
index 5c73061..301e1fc 100644
--- a/sound/soc/au1x/db1200.c
+++ b/sound/soc/au1x/db1200.c
@@ -99,7 +99,7 @@ static int db1200_i2s_startup(struct snd_pcm_substream 
*substream)
return 0;
 }
 
-static struct snd_soc_ops db1200_i2s_wm8731_ops = {
+static const struct snd_soc_ops db1200_i2s_wm8731_ops = {
.startup= db1200_i2s_startup,
 };
 
-- 
1.9.1



[PATCH 3/7] ASoC: generic: make snd_soc_ops const

2017-08-16 Thread Bhumika Goyal
Make these const as they are only stored in the ops field of a
snd_soc_dai_link structure, which is const.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 sound/soc/generic/audio-graph-card.c | 2 +-
 sound/soc/generic/audio-graph-scu-card.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/generic/audio-graph-card.c 
b/sound/soc/generic/audio-graph-card.c
index de2550c..2f7c8cf 100644
--- a/sound/soc/generic/audio-graph-card.c
+++ b/sound/soc/generic/audio-graph-card.c
@@ -95,7 +95,7 @@ static void asoc_graph_card_shutdown(struct snd_pcm_substream 
*substream)
asoc_simple_card_clk_disable(&dai_props->codec_dai);
 }
 
-static struct snd_soc_ops asoc_graph_card_ops = {
+static const struct snd_soc_ops asoc_graph_card_ops = {
.startup = asoc_graph_card_startup,
.shutdown = asoc_graph_card_shutdown,
 };
diff --git a/sound/soc/generic/audio-graph-scu-card.c 
b/sound/soc/generic/audio-graph-scu-card.c
index 758ac06..06b6fcf 100644
--- a/sound/soc/generic/audio-graph-scu-card.c
+++ b/sound/soc/generic/audio-graph-scu-card.c
@@ -56,7 +56,7 @@ static void asoc_graph_card_shutdown(struct snd_pcm_substream 
*substream)
asoc_simple_card_clk_disable(dai_props);
 }
 
-static struct snd_soc_ops asoc_graph_card_ops = {
+static const struct snd_soc_ops asoc_graph_card_ops = {
.startup = asoc_graph_card_startup,
.shutdown = asoc_graph_card_shutdown,
 };
-- 
1.9.1



[PATCH 2/7] ASoC: cirrus: make snd_soc_ops const

2017-08-16 Thread Bhumika Goyal
Make these const as they are only stored in the ops field of a
snd_soc_dai_link structure, which is const.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 sound/soc/cirrus/edb93xx.c | 2 +-
 sound/soc/cirrus/snappercl15.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/cirrus/edb93xx.c b/sound/soc/cirrus/edb93xx.c
index 85962657..c53bd6f 100644
--- a/sound/soc/cirrus/edb93xx.c
+++ b/sound/soc/cirrus/edb93xx.c
@@ -56,7 +56,7 @@ static int edb93xx_hw_params(struct snd_pcm_substream 
*substream,
  SND_SOC_CLOCK_OUT);
 }
 
-static struct snd_soc_ops edb93xx_ops = {
+static const struct snd_soc_ops edb93xx_ops = {
.hw_params  = edb93xx_hw_params,
 };
 
diff --git a/sound/soc/cirrus/snappercl15.c b/sound/soc/cirrus/snappercl15.c
index 98089df..2334ec1 100644
--- a/sound/soc/cirrus/snappercl15.c
+++ b/sound/soc/cirrus/snappercl15.c
@@ -45,7 +45,7 @@ static int snappercl15_hw_params(struct snd_pcm_substream 
*substream,
return 0;
 }
 
-static struct snd_soc_ops snappercl15_ops = {
+static const struct snd_soc_ops snappercl15_ops = {
.hw_params  = snappercl15_hw_params,
 };
 
-- 
1.9.1



[PATCH 5/7] ASoC: rockchip: make snd_soc_ops const

2017-08-16 Thread Bhumika Goyal
Make this const as it is only stored in the ops field of a
snd_soc_dai_link structure, which is const.
Done using Coccinelle

Signed-off-by: Bhumika Goyal 
---
 sound/soc/rockchip/rk3288_hdmi_analog.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/rockchip/rk3288_hdmi_analog.c 
b/sound/soc/rockchip/rk3288_hdmi_analog.c
index dbc53e4..42227b0 100644
--- a/sound/soc/rockchip/rk3288_hdmi_analog.c
+++ b/sound/soc/rockchip/rk3288_hdmi_analog.c
@@ -147,7 +147,7 @@ static int rk_init(struct snd_soc_pcm_runtime *runtime)
return 0;
 }
 
-static struct snd_soc_ops rk_ops = {
+static const struct snd_soc_ops rk_ops = {
.hw_params = rk_hw_params,
 };
 
-- 
1.9.1



[PATCH 4/7] ASoC: pxa: make snd_soc_ops const

2017-08-16 Thread Bhumika Goyal
Make this const as it is only stored in the ops field of a
snd_soc_dai_link structure, which is const.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 sound/soc/pxa/raumfeld.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/pxa/raumfeld.c b/sound/soc/pxa/raumfeld.c
index 111a907..43f6ab7 100644
--- a/sound/soc/pxa/raumfeld.c
+++ b/sound/soc/pxa/raumfeld.c
@@ -196,7 +196,7 @@ static int raumfeld_ak4104_hw_params(struct 
snd_pcm_substream *substream,
return 0;
 }
 
-static struct snd_soc_ops raumfeld_ak4104_ops = {
+static const struct snd_soc_ops raumfeld_ak4104_ops = {
.hw_params = raumfeld_ak4104_hw_params,
 };
 
-- 
1.9.1



[PATCH 7/7] ASoC: sh: make snd_soc_ops const

2017-08-16 Thread Bhumika Goyal
Make this const as it is only stored in the ops field of a
snd_soc_dai_link structure, which is const.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 sound/soc/sh/migor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/sh/migor.c b/sound/soc/sh/migor.c
index 672bcd4..ecb057f 100644
--- a/sound/soc/sh/migor.c
+++ b/sound/soc/sh/migor.c
@@ -98,7 +98,7 @@ static int migor_hw_free(struct snd_pcm_substream *substream)
return 0;
 }
 
-static struct snd_soc_ops migor_dai_ops = {
+static const struct snd_soc_ops migor_dai_ops = {
.hw_params = migor_hw_params,
.hw_free = migor_hw_free,
 };
-- 
1.9.1



[PATCH 6/7] ASoC: samsung: make snd_soc_ops const

2017-08-16 Thread Bhumika Goyal
Make these const as they are only stored in the ops field of a
snd_soc_dai_link structure, which is const.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 sound/soc/samsung/jive_wm8750.c | 2 +-
 sound/soc/samsung/s3c24xx_simtec.c  | 2 +-
 sound/soc/samsung/s3c24xx_uda134x.c | 2 +-
 sound/soc/samsung/smdk_spdif.c  | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/sound/soc/samsung/jive_wm8750.c b/sound/soc/samsung/jive_wm8750.c
index 7fcb51f..529b10d 100644
--- a/sound/soc/samsung/jive_wm8750.c
+++ b/sound/soc/samsung/jive_wm8750.c
@@ -79,7 +79,7 @@ static int jive_hw_params(struct snd_pcm_substream *substream,
return 0;
 }
 
-static struct snd_soc_ops jive_ops = {
+static const struct snd_soc_ops jive_ops = {
.hw_params  = jive_hw_params,
 };
 
diff --git a/sound/soc/samsung/s3c24xx_simtec.c 
b/sound/soc/samsung/s3c24xx_simtec.c
index dcc008d..6de63f3 100644
--- a/sound/soc/samsung/s3c24xx_simtec.c
+++ b/sound/soc/samsung/s3c24xx_simtec.c
@@ -211,7 +211,7 @@ static int simtec_call_startup(struct 
s3c24xx_audio_simtec_pdata *pd)
return 0;
 }
 
-static struct snd_soc_ops simtec_snd_ops = {
+static const struct snd_soc_ops simtec_snd_ops = {
.hw_params  = simtec_hw_params,
 };
 
diff --git a/sound/soc/samsung/s3c24xx_uda134x.c 
b/sound/soc/samsung/s3c24xx_uda134x.c
index 55538e3..c65c89d 100644
--- a/sound/soc/samsung/s3c24xx_uda134x.c
+++ b/sound/soc/samsung/s3c24xx_uda134x.c
@@ -199,7 +199,7 @@ static int s3c24xx_uda134x_hw_params(struct 
snd_pcm_substream *substream,
return 0;
 }
 
-static struct snd_soc_ops s3c24xx_uda134x_ops = {
+static const struct snd_soc_ops s3c24xx_uda134x_ops = {
.startup = s3c24xx_uda134x_startup,
.shutdown = s3c24xx_uda134x_shutdown,
.hw_params = s3c24xx_uda134x_hw_params,
diff --git a/sound/soc/samsung/smdk_spdif.c b/sound/soc/samsung/smdk_spdif.c
index a2f2363..7fc7cc6 100644
--- a/sound/soc/samsung/smdk_spdif.c
+++ b/sound/soc/samsung/smdk_spdif.c
@@ -144,7 +144,7 @@ static int smdk_hw_params(struct snd_pcm_substream 
*substream,
return ret;
 }
 
-static struct snd_soc_ops smdk_spdif_ops = {
+static const struct snd_soc_ops smdk_spdif_ops = {
.hw_params = smdk_hw_params,
 };
 
-- 
1.9.1



[PATCH 1/2] ASoC: bcm: make snd_soc_dai_driver const

2017-08-16 Thread Bhumika Goyal
Make this const as it is only used during a copy operation.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 sound/soc/bcm/cygnus-ssp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/bcm/cygnus-ssp.c b/sound/soc/bcm/cygnus-ssp.c
index 1a57a4e..15c438f 100644
--- a/sound/soc/bcm/cygnus-ssp.c
+++ b/sound/soc/bcm/cygnus-ssp.c
@@ -1165,7 +1165,7 @@ static int cygnus_ssp_resume(struct snd_soc_dai *cpu_dai)
INIT_CPU_DAI(2),
 };
 
-static struct snd_soc_dai_driver cygnus_spdif_dai_info = {
+static const struct snd_soc_dai_driver cygnus_spdif_dai_info = {
.name = "cygnus-spdif",
.playback = {
.channels_min = 2,
-- 
1.9.1



[PATCH 0/2] ASoC: make snd_soc_dai_driver and snd_soc_component_driver const

2017-08-16 Thread Bhumika Goyal
Make these const.

Bhumika Goyal (2):
  ASoC: bcm: make snd_soc_dai_driver const
  ASoC: codecs: make snd_soc_dai_driver and snd_soc_component_driver
const

 sound/soc/bcm/cygnus-ssp.c| 2 +-
 sound/soc/codecs/hdmi-codec.c | 2 +-
 sound/soc/codecs/lm4857.c | 2 +-
 sound/soc/codecs/max9768.c| 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

-- 
1.9.1



[PATCH 2/2] ASoC: codecs: make snd_soc_dai_driver and snd_soc_component_driver const

2017-08-16 Thread Bhumika Goyal
Make these two structure variables const as they are either used in a
copy operation or passed to devm_snd_soc_register_component having the
corresponding argument as const.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 sound/soc/codecs/hdmi-codec.c | 2 +-
 sound/soc/codecs/lm4857.c | 2 +-
 sound/soc/codecs/max9768.c| 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/soc/codecs/hdmi-codec.c b/sound/soc/codecs/hdmi-codec.c
index 7aba4f3..ce1be8b 100644
--- a/sound/soc/codecs/hdmi-codec.c
+++ b/sound/soc/codecs/hdmi-codec.c
@@ -692,7 +692,7 @@ static int hdmi_codec_pcm_new(struct snd_soc_pcm_runtime 
*rtd,
return snd_ctl_add(rtd->card->snd_card, kctl);
 }
 
-static struct snd_soc_dai_driver hdmi_i2s_dai = {
+static const struct snd_soc_dai_driver hdmi_i2s_dai = {
.name = "i2s-hifi",
.id = DAI_ID_I2S,
.playback = {
diff --git a/sound/soc/codecs/lm4857.c b/sound/soc/codecs/lm4857.c
index 558de10..1e96407 100644
--- a/sound/soc/codecs/lm4857.c
+++ b/sound/soc/codecs/lm4857.c
@@ -100,7 +100,7 @@ static 
SOC_VALUE_ENUM_SINGLE_AUTODISABLE_DECL(lm4857_mode_enum,
{ "EP", "Earpiece", "Mode" },
 };
 
-static struct snd_soc_component_driver lm4857_component_driver = {
+static const struct snd_soc_component_driver lm4857_component_driver = {
.controls = lm4857_controls,
.num_controls = ARRAY_SIZE(lm4857_controls),
.dapm_widgets = lm4857_dapm_widgets,
diff --git a/sound/soc/codecs/max9768.c b/sound/soc/codecs/max9768.c
index 5b82e26..7017c03 100644
--- a/sound/soc/codecs/max9768.c
+++ b/sound/soc/codecs/max9768.c
@@ -151,7 +151,7 @@ static int max9768_probe(struct snd_soc_component 
*component)
return 0;
 }
 
-static struct snd_soc_component_driver max9768_component_driver = {
+static const struct snd_soc_component_driver max9768_component_driver = {
.probe = max9768_probe,
.controls = max9768_volume,
.num_controls = ARRAY_SIZE(max9768_volume),
-- 
1.9.1



[PATCH 02/12] ALSA: atmel: make snd_pcm_hardware const

2017-08-17 Thread Bhumika Goyal
Make this const as it is only used in a copy operation.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 sound/atmel/ac97c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/atmel/ac97c.c b/sound/atmel/ac97c.c
index 52b0522..f3f582e 100644
--- a/sound/atmel/ac97c.c
+++ b/sound/atmel/ac97c.c
@@ -66,7 +66,7 @@ struct atmel_ac97c {
 #define ac97c_readl(chip, reg) \
__raw_readl((chip)->regs + AC97C_##reg)
 
-static struct snd_pcm_hardware atmel_ac97c_hw = {
+static const struct snd_pcm_hardware atmel_ac97c_hw = {
.info   = (SNDRV_PCM_INFO_MMAP
  | SNDRV_PCM_INFO_MMAP_VALID
  | SNDRV_PCM_INFO_INTERLEAVED
-- 
1.9.1



[PATCH 03/12] ALSA: drivers: make snd_pcm_hardware const

2017-08-17 Thread Bhumika Goyal
Make these const as they are only used in a copy operation.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 sound/drivers/aloop.c | 2 +-
 sound/drivers/dummy.c | 2 +-
 sound/drivers/ml403-ac97cr.c  | 4 ++--
 sound/drivers/pcsp/pcsp_lib.c | 2 +-
 sound/drivers/vx/vx_pcm.c | 4 ++--
 5 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/sound/drivers/aloop.c b/sound/drivers/aloop.c
index 54f348a..6e02ee0 100644
--- a/sound/drivers/aloop.c
+++ b/sound/drivers/aloop.c
@@ -561,7 +561,7 @@ static snd_pcm_uframes_t loopback_pointer(struct 
snd_pcm_substream *substream)
return bytes_to_frames(runtime, pos);
 }
 
-static struct snd_pcm_hardware loopback_pcm_hardware =
+static const struct snd_pcm_hardware loopback_pcm_hardware =
 {
.info = (SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_MMAP |
 SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_PAUSE |
diff --git a/sound/drivers/dummy.c b/sound/drivers/dummy.c
index dd5ed03..c0939a0 100644
--- a/sound/drivers/dummy.c
+++ b/sound/drivers/dummy.c
@@ -520,7 +520,7 @@ static snd_pcm_uframes_t dummy_pcm_pointer(struct 
snd_pcm_substream *substream)
return get_dummy_ops(substream)->pointer(substream);
 }
 
-static struct snd_pcm_hardware dummy_pcm_hardware = {
+static const struct snd_pcm_hardware dummy_pcm_hardware = {
.info = (SNDRV_PCM_INFO_MMAP |
 SNDRV_PCM_INFO_INTERLEAVED |
 SNDRV_PCM_INFO_RESUME |
diff --git a/sound/drivers/ml403-ac97cr.c b/sound/drivers/ml403-ac97cr.c
index bdcb572..d634e10 100644
--- a/sound/drivers/ml403-ac97cr.c
+++ b/sound/drivers/ml403-ac97cr.c
@@ -373,7 +373,7 @@ struct snd_ml403_ac97cr {
struct snd_pcm_indirect2 capture_ind2_rec;
 };
 
-static struct snd_pcm_hardware snd_ml403_ac97cr_playback = {
+static const struct snd_pcm_hardware snd_ml403_ac97cr_playback = {
.info = (SNDRV_PCM_INFO_MMAP |
 SNDRV_PCM_INFO_INTERLEAVED |
 SNDRV_PCM_INFO_MMAP_VALID),
@@ -392,7 +392,7 @@ struct snd_ml403_ac97cr {
.fifo_size =0,
 };
 
-static struct snd_pcm_hardware snd_ml403_ac97cr_capture = {
+static const struct snd_pcm_hardware snd_ml403_ac97cr_capture = {
.info = (SNDRV_PCM_INFO_MMAP |
 SNDRV_PCM_INFO_INTERLEAVED |
 SNDRV_PCM_INFO_MMAP_VALID),
diff --git a/sound/drivers/pcsp/pcsp_lib.c b/sound/drivers/pcsp/pcsp_lib.c
index 44b3632..2f5a35f 100644
--- a/sound/drivers/pcsp/pcsp_lib.c
+++ b/sound/drivers/pcsp/pcsp_lib.c
@@ -285,7 +285,7 @@ static snd_pcm_uframes_t snd_pcsp_playback_pointer(struct 
snd_pcm_substream
return bytes_to_frames(substream->runtime, pos);
 }
 
-static struct snd_pcm_hardware snd_pcsp_playback = {
+static const struct snd_pcm_hardware snd_pcsp_playback = {
.info = (SNDRV_PCM_INFO_INTERLEAVED |
 SNDRV_PCM_INFO_HALF_DUPLEX |
 SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID),
diff --git a/sound/drivers/vx/vx_pcm.c b/sound/drivers/vx/vx_pcm.c
index d318a33..380a028 100644
--- a/sound/drivers/vx/vx_pcm.c
+++ b/sound/drivers/vx/vx_pcm.c
@@ -500,7 +500,7 @@ static int vx_stop_stream(struct vx_core *chip, struct 
vx_pipe *pipe)
  * playback hw information
  */
 
-static struct snd_pcm_hardware vx_pcm_playback_hw = {
+static const struct snd_pcm_hardware vx_pcm_playback_hw = {
.info = (SNDRV_PCM_INFO_MMAP | 
SNDRV_PCM_INFO_INTERLEAVED |
 SNDRV_PCM_INFO_PAUSE | 
SNDRV_PCM_INFO_MMAP_VALID /*|*/
 /*SNDRV_PCM_INFO_RESUME*/),
@@ -891,7 +891,7 @@ static int vx_pcm_prepare(struct snd_pcm_substream *subs)
  * playback hw information
  */
 
-static struct snd_pcm_hardware vx_pcm_capture_hw = {
+static const struct snd_pcm_hardware vx_pcm_capture_hw = {
.info = (SNDRV_PCM_INFO_MMAP | 
SNDRV_PCM_INFO_INTERLEAVED |
 SNDRV_PCM_INFO_PAUSE | 
SNDRV_PCM_INFO_MMAP_VALID /*|*/
 /*SNDRV_PCM_INFO_RESUME*/),
-- 
1.9.1



[PATCH 00/12] ALSA: make snd_pcm_hardware const

2017-08-17 Thread Bhumika Goyal
Make these const.

Bhumika Goyal (12):
  ALSA: arm: make snd_pcm_hardware const
  ALSA: atmel: make snd_pcm_hardware const
  ALSA: drivers: make snd_pcm_hardware const
  ALSA: isa: make snd_pcm_hardware const
  ALSA: mips: make snd_pcm_hardware const
  ALSA: pci: make snd_pcm_hardware const
  ALSA: pcmcia: make snd_pcm_hardware const
  ALSA: ppc: make snd_pcm_hardware const
  ALSA: sh: make snd_pcm_hardware const
  ALSA: sparc: make snd_pcm_hardware const
  ALSA: usb: make snd_pcm_hardware const
  ALSA: parisc: make snd_pcm_hardware const

 sound/arm/aaci.c   | 2 +-
 sound/atmel/ac97c.c| 2 +-
 sound/drivers/aloop.c  | 2 +-
 sound/drivers/dummy.c  | 2 +-
 sound/drivers/ml403-ac97cr.c   | 4 ++--
 sound/drivers/pcsp/pcsp_lib.c  | 2 +-
 sound/drivers/vx/vx_pcm.c  | 4 ++--
 sound/isa/ad1816a/ad1816a_lib.c| 4 ++--
 sound/isa/es1688/es1688_lib.c  | 4 ++--
 sound/isa/es18xx.c | 4 ++--
 sound/isa/gus/gus_pcm.c| 4 ++--
 sound/isa/msnd/msnd.c  | 4 ++--
 sound/isa/sb/emu8000_pcm.c | 2 +-
 sound/isa/sb/sb16_main.c   | 4 ++--
 sound/isa/sb/sb8_main.c| 4 ++--
 sound/isa/wss/wss_lib.c| 4 ++--
 sound/mips/hal2.c  | 2 +-
 sound/mips/sgio2audio.c| 2 +-
 sound/parisc/harmony.c | 4 ++--
 sound/pci/au88x0/au88x0_pcm.c  | 8 
 sound/pcmcia/pdaudiocf/pdaudiocf_pcm.c | 2 +-
 sound/ppc/pmac.c   | 4 ++--
 sound/sh/aica.c| 2 +-
 sound/sh/sh_dac_audio.c| 2 +-
 sound/sparc/amd7930.c  | 2 +-
 sound/sparc/cs4231.c   | 4 ++--
 sound/sparc/dbri.c | 2 +-
 sound/usb/pcm.c| 2 +-
 28 files changed, 44 insertions(+), 44 deletions(-)

-- 
1.9.1



[PATCH 06/12] ALSA: pci: make snd_pcm_hardware const

2017-08-17 Thread Bhumika Goyal
Make these const as they are only used in a copy operation.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 sound/pci/au88x0/au88x0_pcm.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sound/pci/au88x0/au88x0_pcm.c b/sound/pci/au88x0/au88x0_pcm.c
index 848eb3c..53714e0 100644
--- a/sound/pci/au88x0/au88x0_pcm.c
+++ b/sound/pci/au88x0/au88x0_pcm.c
@@ -30,7 +30,7 @@
 #define VORTEX_PCM_TYPE(x) (x->name[40])
 
 /* hardware definition */
-static struct snd_pcm_hardware snd_vortex_playback_hw_adb = {
+static const struct snd_pcm_hardware snd_vortex_playback_hw_adb = {
.info =
(SNDRV_PCM_INFO_MMAP | /* SNDRV_PCM_INFO_RESUME | */
 SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_INTERLEAVED |
@@ -51,7 +51,7 @@
 };
 
 #ifndef CHIP_AU8820
-static struct snd_pcm_hardware snd_vortex_playback_hw_a3d = {
+static const struct snd_pcm_hardware snd_vortex_playback_hw_a3d = {
.info =
(SNDRV_PCM_INFO_MMAP | /* SNDRV_PCM_INFO_RESUME | */
 SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_INTERLEAVED |
@@ -71,7 +71,7 @@
.periods_max = 64,
 };
 #endif
-static struct snd_pcm_hardware snd_vortex_playback_hw_spdif = {
+static const struct snd_pcm_hardware snd_vortex_playback_hw_spdif = {
.info =
(SNDRV_PCM_INFO_MMAP | /* SNDRV_PCM_INFO_RESUME | */
 SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_INTERLEAVED |
@@ -94,7 +94,7 @@
 };
 
 #ifndef CHIP_AU8810
-static struct snd_pcm_hardware snd_vortex_playback_hw_wt = {
+static const struct snd_pcm_hardware snd_vortex_playback_hw_wt = {
.info = (SNDRV_PCM_INFO_MMAP |
 SNDRV_PCM_INFO_INTERLEAVED |
 SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_MMAP_VALID),
-- 
1.9.1



[PATCH 01/12] ALSA: arm: make snd_pcm_hardware const

2017-08-17 Thread Bhumika Goyal
Make this const as it is only used in a copy operation.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 sound/arm/aaci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/arm/aaci.c b/sound/arm/aaci.c
index 4140b1b..74cf452 100644
--- a/sound/arm/aaci.c
+++ b/sound/arm/aaci.c
@@ -348,7 +348,7 @@ static irqreturn_t aaci_irq(int irq, void *devid)
 /*
  * ALSA support.
  */
-static struct snd_pcm_hardware aaci_hw_info = {
+static const struct snd_pcm_hardware aaci_hw_info = {
.info   = SNDRV_PCM_INFO_MMAP |
  SNDRV_PCM_INFO_MMAP_VALID |
  SNDRV_PCM_INFO_INTERLEAVED |
-- 
1.9.1



[PATCH 07/12] ALSA: pcmcia: make snd_pcm_hardware const

2017-08-17 Thread Bhumika Goyal
Make this const as it is only used in a copy operation.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 sound/pcmcia/pdaudiocf/pdaudiocf_pcm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf_pcm.c 
b/sound/pcmcia/pdaudiocf/pdaudiocf_pcm.c
index b48aa0a..d788409 100644
--- a/sound/pcmcia/pdaudiocf/pdaudiocf_pcm.c
+++ b/sound/pcmcia/pdaudiocf/pdaudiocf_pcm.c
@@ -193,7 +193,7 @@ static int pdacf_pcm_prepare(struct snd_pcm_substream *subs)
  * capture hw information
  */
 
-static struct snd_pcm_hardware pdacf_pcm_capture_hw = {
+static const struct snd_pcm_hardware pdacf_pcm_capture_hw = {
.info = (SNDRV_PCM_INFO_MMAP | 
SNDRV_PCM_INFO_INTERLEAVED |
 SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME |
 SNDRV_PCM_INFO_MMAP_VALID |
-- 
1.9.1



[PATCH 08/12] ALSA: ppc: make snd_pcm_hardware const

2017-08-17 Thread Bhumika Goyal
Make these const as they are only used in a copy operation.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 sound/ppc/pmac.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/ppc/pmac.c b/sound/ppc/pmac.c
index a5843fc..45f0295 100644
--- a/sound/ppc/pmac.c
+++ b/sound/ppc/pmac.c
@@ -509,7 +509,7 @@ static void snd_pmac_pcm_update(struct snd_pmac *chip, 
struct pmac_stream *rec)
  * hw info
  */
 
-static struct snd_pcm_hardware snd_pmac_playback =
+static const struct snd_pcm_hardware snd_pmac_playback =
 {
.info = (SNDRV_PCM_INFO_INTERLEAVED |
 SNDRV_PCM_INFO_MMAP |
@@ -528,7 +528,7 @@ static void snd_pmac_pcm_update(struct snd_pmac *chip, 
struct pmac_stream *rec)
.periods_max =  PMAC_MAX_FRAGS,
 };
 
-static struct snd_pcm_hardware snd_pmac_capture =
+static const struct snd_pcm_hardware snd_pmac_capture =
 {
.info = (SNDRV_PCM_INFO_INTERLEAVED |
 SNDRV_PCM_INFO_MMAP |
-- 
1.9.1



[PATCH 09/12] ALSA: sh: make snd_pcm_hardware const

2017-08-17 Thread Bhumika Goyal
Make these const as they are only used in a copy operation.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 sound/sh/aica.c | 2 +-
 sound/sh/sh_dac_audio.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/sh/aica.c b/sound/sh/aica.c
index ab4802d..822608d 100644
--- a/sound/sh/aica.c
+++ b/sound/sh/aica.c
@@ -211,7 +211,7 @@ static void aica_chn_halt(void)
 }
 
 /* ALSA code below */
-static struct snd_pcm_hardware snd_pcm_aica_playback_hw = {
+static const struct snd_pcm_hardware snd_pcm_aica_playback_hw = {
.info = (SNDRV_PCM_INFO_NONINTERLEAVED),
.formats =
(SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_LE |
diff --git a/sound/sh/sh_dac_audio.c b/sound/sh/sh_dac_audio.c
index c1e00ed..a077f1c 100644
--- a/sound/sh/sh_dac_audio.c
+++ b/sound/sh/sh_dac_audio.c
@@ -93,7 +93,7 @@ static void dac_audio_set_rate(struct snd_sh_dac *chip)
 
 /* PCM INTERFACE */
 
-static struct snd_pcm_hardware snd_sh_dac_pcm_hw = {
+static const struct snd_pcm_hardware snd_sh_dac_pcm_hw = {
.info   = (SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_MMAP_VALID |
SNDRV_PCM_INFO_INTERLEAVED |
-- 
1.9.1



[PATCH 10/12] ALSA: sparc: make snd_pcm_hardware const

2017-08-17 Thread Bhumika Goyal
Make these const as they are only used in a copy operation.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 sound/sparc/amd7930.c | 2 +-
 sound/sparc/cs4231.c  | 4 ++--
 sound/sparc/dbri.c| 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/sound/sparc/amd7930.c b/sound/sparc/amd7930.c
index 35c1f6a..a6864fd 100644
--- a/sound/sparc/amd7930.c
+++ b/sound/sparc/amd7930.c
@@ -666,7 +666,7 @@ static snd_pcm_uframes_t snd_amd7930_capture_pointer(struct 
snd_pcm_substream *s
 }
 
 /* Playback and capture have identical properties.  */
-static struct snd_pcm_hardware snd_amd7930_pcm_hw =
+static const struct snd_pcm_hardware snd_amd7930_pcm_hw =
 {
.info   = (SNDRV_PCM_INFO_MMAP |
   SNDRV_PCM_INFO_MMAP_VALID |
diff --git a/sound/sparc/cs4231.c b/sound/sparc/cs4231.c
index 3d7d425..f5192b3 100644
--- a/sound/sparc/cs4231.c
+++ b/sound/sparc/cs4231.c
@@ -1089,7 +1089,7 @@ static int snd_cs4231_probe(struct snd_cs4231 *chip)
return 0;   /* all things are ok.. */
 }
 
-static struct snd_pcm_hardware snd_cs4231_playback = {
+static const struct snd_pcm_hardware snd_cs4231_playback = {
.info   = SNDRV_PCM_INFO_MMAP |
  SNDRV_PCM_INFO_INTERLEAVED |
  SNDRV_PCM_INFO_MMAP_VALID |
@@ -1113,7 +1113,7 @@ static int snd_cs4231_probe(struct snd_cs4231 *chip)
.periods_max= 1024,
 };
 
-static struct snd_pcm_hardware snd_cs4231_capture = {
+static const struct snd_pcm_hardware snd_cs4231_capture = {
.info   = SNDRV_PCM_INFO_MMAP |
  SNDRV_PCM_INFO_INTERLEAVED |
  SNDRV_PCM_INFO_MMAP_VALID |
diff --git a/sound/sparc/dbri.c b/sound/sparc/dbri.c
index 52063b2..72b6c4a 100644
--- a/sound/sparc/dbri.c
+++ b/sound/sparc/dbri.c
@@ -1980,7 +1980,7 @@ static irqreturn_t snd_dbri_interrupt(int irq, void 
*dev_id)
 /
PCM Interface
 /
-static struct snd_pcm_hardware snd_dbri_pcm_hw = {
+static const struct snd_pcm_hardware snd_dbri_pcm_hw = {
.info   = SNDRV_PCM_INFO_MMAP |
  SNDRV_PCM_INFO_INTERLEAVED |
  SNDRV_PCM_INFO_BLOCK_TRANSFER |
-- 
1.9.1



[PATCH 11/12] ALSA: usb: make snd_pcm_hardware const

2017-08-17 Thread Bhumika Goyal
Make this const as it is only used in a copy operation.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 sound/usb/pcm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c
index 9aa5b18..a4f3390 100644
--- a/sound/usb/pcm.c
+++ b/sound/usb/pcm.c
@@ -857,7 +857,7 @@ static int snd_usb_pcm_prepare(struct snd_pcm_substream 
*substream)
return ret;
 }
 
-static struct snd_pcm_hardware snd_usb_hardware =
+static const struct snd_pcm_hardware snd_usb_hardware =
 {
.info = SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_MMAP_VALID |
-- 
1.9.1



[PATCH 12/12] ALSA: parisc: make snd_pcm_hardware const

2017-08-17 Thread Bhumika Goyal
Make these const as they are only used in a copy operation.
Done using Coccinelle

Signed-off-by: Bhumika Goyal 
---
 sound/parisc/harmony.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/parisc/harmony.c b/sound/parisc/harmony.c
index 5911eb3..cb2bc54 100644
--- a/sound/parisc/harmony.c
+++ b/sound/parisc/harmony.c
@@ -260,7 +260,7 @@
return HARMONY_SR_44KHZ;
 }
 
-static struct snd_pcm_hardware snd_harmony_playback =
+static const struct snd_pcm_hardware snd_harmony_playback =
 {
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 
 SNDRV_PCM_INFO_JOINT_DUPLEX | SNDRV_PCM_INFO_MMAP_VALID |
@@ -281,7 +281,7 @@
.fifo_size = 0,
 };
 
-static struct snd_pcm_hardware snd_harmony_capture =
+static const struct snd_pcm_hardware snd_harmony_capture =
 {
 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
  SNDRV_PCM_INFO_JOINT_DUPLEX | SNDRV_PCM_INFO_MMAP_VALID |
-- 
1.9.1



[PATCH 05/12] ALSA: mips: make snd_pcm_hardware const

2017-08-17 Thread Bhumika Goyal
Make these const as they are only used in a copy operation.
Done using Coccinelle

Signed-off-by: Bhumika Goyal 
---
 sound/mips/hal2.c   | 2 +-
 sound/mips/sgio2audio.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/mips/hal2.c b/sound/mips/hal2.c
index 3318c15..367d6c37 100644
--- a/sound/mips/hal2.c
+++ b/sound/mips/hal2.c
@@ -496,7 +496,7 @@ static void hal2_free_dmabuf(struct hal2_codec *codec)
   DMA_ATTR_NON_CONSISTENT);
 }
 
-static struct snd_pcm_hardware hal2_pcm_hw = {
+static const struct snd_pcm_hardware hal2_pcm_hw = {
.info = (SNDRV_PCM_INFO_MMAP |
 SNDRV_PCM_INFO_MMAP_VALID |
 SNDRV_PCM_INFO_INTERLEAVED |
diff --git a/sound/mips/sgio2audio.c b/sound/mips/sgio2audio.c
index 0ebc1c3..603892f 100644
--- a/sound/mips/sgio2audio.c
+++ b/sound/mips/sgio2audio.c
@@ -532,7 +532,7 @@ static irqreturn_t snd_sgio2audio_error_isr(int irq, void 
*dev_id)
 
 /* PCM part */
 /* PCM hardware definition */
-static struct snd_pcm_hardware snd_sgio2audio_pcm_hw = {
+static const struct snd_pcm_hardware snd_sgio2audio_pcm_hw = {
.info = (SNDRV_PCM_INFO_MMAP |
 SNDRV_PCM_INFO_MMAP_VALID |
 SNDRV_PCM_INFO_INTERLEAVED |
-- 
1.9.1



[PATCH 04/12] ALSA: isa: make snd_pcm_hardware const

2017-08-17 Thread Bhumika Goyal
Make these const as they are only used in a copy operation.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 sound/isa/ad1816a/ad1816a_lib.c | 4 ++--
 sound/isa/es1688/es1688_lib.c   | 4 ++--
 sound/isa/es18xx.c  | 4 ++--
 sound/isa/gus/gus_pcm.c | 4 ++--
 sound/isa/msnd/msnd.c   | 4 ++--
 sound/isa/sb/emu8000_pcm.c  | 2 +-
 sound/isa/sb/sb16_main.c| 4 ++--
 sound/isa/sb/sb8_main.c | 4 ++--
 sound/isa/wss/wss_lib.c | 4 ++--
 9 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/sound/isa/ad1816a/ad1816a_lib.c b/sound/isa/ad1816a/ad1816a_lib.c
index 5c6df15..9232014 100644
--- a/sound/isa/ad1816a/ad1816a_lib.c
+++ b/sound/isa/ad1816a/ad1816a_lib.c
@@ -339,7 +339,7 @@ static irqreturn_t snd_ad1816a_interrupt(int irq, void 
*dev_id)
 }
 
 
-static struct snd_pcm_hardware snd_ad1816a_playback = {
+static const struct snd_pcm_hardware snd_ad1816a_playback = {
.info = (SNDRV_PCM_INFO_MMAP | 
SNDRV_PCM_INFO_INTERLEAVED |
 SNDRV_PCM_INFO_MMAP_VALID),
.formats =  (SNDRV_PCM_FMTBIT_MU_LAW | 
SNDRV_PCM_FMTBIT_A_LAW |
@@ -358,7 +358,7 @@ static irqreturn_t snd_ad1816a_interrupt(int irq, void 
*dev_id)
.fifo_size =0,
 };
 
-static struct snd_pcm_hardware snd_ad1816a_capture = {
+static const struct snd_pcm_hardware snd_ad1816a_capture = {
.info = (SNDRV_PCM_INFO_MMAP | 
SNDRV_PCM_INFO_INTERLEAVED |
 SNDRV_PCM_INFO_MMAP_VALID),
.formats =  (SNDRV_PCM_FMTBIT_MU_LAW | 
SNDRV_PCM_FMTBIT_A_LAW |
diff --git a/sound/isa/es1688/es1688_lib.c b/sound/isa/es1688/es1688_lib.c
index ec7e68b..f9c0662 100644
--- a/sound/isa/es1688/es1688_lib.c
+++ b/sound/isa/es1688/es1688_lib.c
@@ -526,7 +526,7 @@ static snd_pcm_uframes_t snd_es1688_capture_pointer(struct 
snd_pcm_substream *su
 
  */
 
-static struct snd_pcm_hardware snd_es1688_playback =
+static const struct snd_pcm_hardware snd_es1688_playback =
 {
.info = (SNDRV_PCM_INFO_MMAP | 
SNDRV_PCM_INFO_INTERLEAVED |
 SNDRV_PCM_INFO_MMAP_VALID),
@@ -544,7 +544,7 @@ static snd_pcm_uframes_t snd_es1688_capture_pointer(struct 
snd_pcm_substream *su
.fifo_size =0,
 };
 
-static struct snd_pcm_hardware snd_es1688_capture =
+static const struct snd_pcm_hardware snd_es1688_capture =
 {
.info = (SNDRV_PCM_INFO_MMAP | 
SNDRV_PCM_INFO_INTERLEAVED |
 SNDRV_PCM_INFO_MMAP_VALID),
diff --git a/sound/isa/es18xx.c b/sound/isa/es18xx.c
index 77023e4..cb9c9a1 100644
--- a/sound/isa/es18xx.c
+++ b/sound/isa/es18xx.c
@@ -838,7 +838,7 @@ static snd_pcm_uframes_t snd_es18xx_capture_pointer(struct 
snd_pcm_substream *su
return pos >> chip->dma1_shift;
 }
 
-static struct snd_pcm_hardware snd_es18xx_playback =
+static const struct snd_pcm_hardware snd_es18xx_playback =
 {
.info = (SNDRV_PCM_INFO_MMAP | 
SNDRV_PCM_INFO_INTERLEAVED |
 SNDRV_PCM_INFO_RESUME |
@@ -858,7 +858,7 @@ static snd_pcm_uframes_t snd_es18xx_capture_pointer(struct 
snd_pcm_substream *su
.fifo_size =0,
 };
 
-static struct snd_pcm_hardware snd_es18xx_capture =
+static const struct snd_pcm_hardware snd_es18xx_capture =
 {
.info = (SNDRV_PCM_INFO_MMAP | 
SNDRV_PCM_INFO_INTERLEAVED |
 SNDRV_PCM_INFO_RESUME |
diff --git a/sound/isa/gus/gus_pcm.c b/sound/isa/gus/gus_pcm.c
index 36e852f..131b289 100644
--- a/sound/isa/gus/gus_pcm.c
+++ b/sound/isa/gus/gus_pcm.c
@@ -650,7 +650,7 @@ static void snd_gf1_pcm_interrupt_dma_read(struct 
snd_gus_card * gus)
}
 }
 
-static struct snd_pcm_hardware snd_gf1_pcm_playback =
+static const struct snd_pcm_hardware snd_gf1_pcm_playback =
 {
.info = SNDRV_PCM_INFO_NONINTERLEAVED,
.formats= (SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_U8 |
@@ -668,7 +668,7 @@ static void snd_gf1_pcm_interrupt_dma_read(struct 
snd_gus_card * gus)
.fifo_size =0,
 };
 
-static struct snd_pcm_hardware snd_gf1_pcm_capture =
+static const struct snd_pcm_hardware snd_gf1_pcm_capture =
 {
.info = (SNDRV_PCM_INFO_MMAP | 
SNDRV_PCM_INFO_INTERLEAVED |
 SNDRV_PCM_INFO_MMAP_VALID),
diff --git a/sound/isa/msnd/msnd.c b/sound/isa/msnd/msnd.c
index ae9562c..569897f 100644
--- a/sound/isa/msnd/msnd.c
+++ b/sound/isa/msnd/msnd.c
@@ -437,7 +437,7 @@ static void snd_msnd_capture_reset_queue(struct snd_msnd 
*chip,
}
 }
 
-static struct snd_pcm_hardware snd_msnd_playback = {
+static const struct snd_pcm_hardware snd_msnd_playback = {
.info = SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_M

[PATCH 1/6] ASoC: fsl: make snd_pcm_hardware const

2017-08-17 Thread Bhumika Goyal
Make these const as they are only passed as the 2nd argument to the
function snd_soc_set_runtime_hwparams, which is const.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 sound/soc/fsl/fsl_asrc_dma.c | 2 +-
 sound/soc/fsl/imx-pcm-fiq.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/fsl/fsl_asrc_dma.c b/sound/soc/fsl/fsl_asrc_dma.c
index 2baf196..e1b97e5 100644
--- a/sound/soc/fsl/fsl_asrc_dma.c
+++ b/sound/soc/fsl/fsl_asrc_dma.c
@@ -20,7 +20,7 @@
 
 #define FSL_ASRC_DMABUF_SIZE   (256 * 1024)
 
-static struct snd_pcm_hardware snd_imx_hardware = {
+static const struct snd_pcm_hardware snd_imx_hardware = {
.info = SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
SNDRV_PCM_INFO_MMAP |
diff --git a/sound/soc/fsl/imx-pcm-fiq.c b/sound/soc/fsl/imx-pcm-fiq.c
index aef1f78..4e5fefe 100644
--- a/sound/soc/fsl/imx-pcm-fiq.c
+++ b/sound/soc/fsl/imx-pcm-fiq.c
@@ -154,7 +154,7 @@ static snd_pcm_uframes_t snd_imx_pcm_pointer(struct 
snd_pcm_substream *substream
return bytes_to_frames(substream->runtime, iprtd->offset);
 }
 
-static struct snd_pcm_hardware snd_imx_hardware = {
+static const struct snd_pcm_hardware snd_imx_hardware = {
.info = SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
SNDRV_PCM_INFO_MMAP |
-- 
1.9.1



[PATCH 3/6] ASoC: Intel: Skylake: make snd_pcm_hardware const

2017-08-17 Thread Bhumika Goyal
Make this const as it is only passed as the 2nd argument to the
function snd_soc_set_runtime_hwparams, which is const.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 sound/soc/intel/skylake/skl-pcm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/intel/skylake/skl-pcm.c 
b/sound/soc/intel/skylake/skl-pcm.c
index e98d825..f6c9adb 100644
--- a/sound/soc/intel/skylake/skl-pcm.c
+++ b/sound/soc/intel/skylake/skl-pcm.c
@@ -33,7 +33,7 @@
 #define HDA_STEREO 2
 #define HDA_QUAD 4
 
-static struct snd_pcm_hardware azx_pcm_hw = {
+static const struct snd_pcm_hardware azx_pcm_hw = {
.info = (SNDRV_PCM_INFO_MMAP |
 SNDRV_PCM_INFO_INTERLEAVED |
 SNDRV_PCM_INFO_BLOCK_TRANSFER |
-- 
1.9.1



[PATCH 4/6] ASoC: kirkwood: make snd_pcm_hardware const

2017-08-17 Thread Bhumika Goyal
Make this const as it is either passed as the 2nd argument
to the function snd_soc_set_runtime_hwparams, which is const or used in
a copy operation.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 sound/soc/kirkwood/kirkwood-dma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/kirkwood/kirkwood-dma.c 
b/sound/soc/kirkwood/kirkwood-dma.c
index dafd22e..cf23af1 100644
--- a/sound/soc/kirkwood/kirkwood-dma.c
+++ b/sound/soc/kirkwood/kirkwood-dma.c
@@ -27,7 +27,7 @@ static struct kirkwood_dma_data *kirkwood_priv(struct 
snd_pcm_substream *subs)
return snd_soc_dai_get_drvdata(soc_runtime->cpu_dai);
 }
 
-static struct snd_pcm_hardware kirkwood_dma_snd_hw = {
+static const struct snd_pcm_hardware kirkwood_dma_snd_hw = {
.info = SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_MMAP_VALID |
-- 
1.9.1



[PATCH 2/6] ASoC: Intel: Atom: make snd_pcm_hardware const

2017-08-17 Thread Bhumika Goyal
Make this const as it is only used in a copy operation.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 sound/soc/intel/atom/sst-mfld-platform-pcm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/intel/atom/sst-mfld-platform-pcm.c 
b/sound/soc/intel/atom/sst-mfld-platform-pcm.c
index b272df5..43e7fdd 100644
--- a/sound/soc/intel/atom/sst-mfld-platform-pcm.c
+++ b/sound/soc/intel/atom/sst-mfld-platform-pcm.c
@@ -76,7 +76,7 @@ int sst_unregister_dsp(struct sst_device *dev)
 }
 EXPORT_SYMBOL_GPL(sst_unregister_dsp);
 
-static struct snd_pcm_hardware sst_platform_pcm_hw = {
+static const struct snd_pcm_hardware sst_platform_pcm_hw = {
.info = (SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_DOUBLE |
SNDRV_PCM_INFO_PAUSE |
-- 
1.9.1



[PATCH 6/6] ASoC: qcom: make snd_pcm_hardware const

2017-08-17 Thread Bhumika Goyal
Make this const as it is either passed as the 2nd argument
to the function snd_soc_set_runtime_hwparams, which is const or used
in a copy operation.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 sound/soc/qcom/lpass-platform.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/qcom/lpass-platform.c b/sound/soc/qcom/lpass-platform.c
index fb3576a..e1945e1 100644
--- a/sound/soc/qcom/lpass-platform.c
+++ b/sound/soc/qcom/lpass-platform.c
@@ -32,7 +32,7 @@ struct lpass_pcm_data {
 #define LPASS_PLATFORM_BUFFER_SIZE (16 * 1024)
 #define LPASS_PLATFORM_PERIODS 2
 
-static struct snd_pcm_hardware lpass_platform_pcm_hardware = {
+static const struct snd_pcm_hardware lpass_platform_pcm_hardware = {
.info   =   SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_MMAP_VALID |
SNDRV_PCM_INFO_INTERLEAVED |
-- 
1.9.1



[PATCH 5/6] ASoC: sh: make snd_pcm_hardware const

2017-08-17 Thread Bhumika Goyal
Make these const as they are only passed as the 2nd argument to the
function snd_soc_set_runtime_hwparams, which is const.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 sound/soc/sh/dma-sh7760.c | 2 +-
 sound/soc/sh/fsi.c| 2 +-
 sound/soc/sh/rcar/core.c  | 2 +-
 sound/soc/sh/siu_dai.c| 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/sound/soc/sh/dma-sh7760.c b/sound/soc/sh/dma-sh7760.c
index 35788a6..1e7d417 100644
--- a/sound/soc/sh/dma-sh7760.c
+++ b/sound/soc/sh/dma-sh7760.c
@@ -89,7 +89,7 @@ struct camelot_pcm {
 #define DMABRG_PREALLOC_BUFFER 32 * 1024
 #define DMABRG_PREALLOC_BUFFER_MAX 32 * 1024
 
-static struct snd_pcm_hardware camelot_pcm_hardware = {
+static const struct snd_pcm_hardware camelot_pcm_hardware = {
.info = (SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
index 7cf0edb..6d3c770 100644
--- a/sound/soc/sh/fsi.c
+++ b/sound/soc/sh/fsi.c
@@ -1710,7 +1710,7 @@ static int fsi_dai_hw_params(struct snd_pcm_substream 
*substream,
  * pcm ops
  */
 
-static struct snd_pcm_hardware fsi_pcm_hardware = {
+static const struct snd_pcm_hardware fsi_pcm_hardware = {
.info = SNDRV_PCM_INFO_INTERLEAVED  |
SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_MMAP_VALID,
diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
index df39831..1071332 100644
--- a/sound/soc/sh/rcar/core.c
+++ b/sound/soc/sh/rcar/core.c
@@ -843,7 +843,7 @@ static int rsnd_soc_hw_rule_channels(struct 
snd_pcm_hw_params *params,
ir, &ic);
 }
 
-static struct snd_pcm_hardware rsnd_pcm_hardware = {
+static const struct snd_pcm_hardware rsnd_pcm_hardware = {
.info = SNDRV_PCM_INFO_INTERLEAVED  |
SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_MMAP_VALID,
diff --git a/sound/soc/sh/siu_dai.c b/sound/soc/sh/siu_dai.c
index 4a22aad..1605029 100644
--- a/sound/soc/sh/siu_dai.c
+++ b/sound/soc/sh/siu_dai.c
@@ -333,7 +333,7 @@ static void siu_dai_spbstop(struct siu_port *port_info)
 /* API functions   */
 
 /* Playback and capture hardware properties are identical */
-static struct snd_pcm_hardware siu_dai_pcm_hw = {
+static const struct snd_pcm_hardware siu_dai_pcm_hw = {
.info   = SNDRV_PCM_INFO_INTERLEAVED,
.formats= SNDRV_PCM_FMTBIT_S16,
.rates  = SNDRV_PCM_RATE_8000_48000,
-- 
1.9.1



[PATCH 0/6] ASoC: make snd_pcm_hardware const

2017-08-17 Thread Bhumika Goyal
Make these const. Done using Coccinelle

Bhumika Goyal (6):
  ASoC: fsl: make snd_pcm_hardware const
  ASoC: Intel: Atom: make snd_pcm_hardware const
  ASoC: Intel: Skylake: make snd_pcm_hardware const
  ASoC: kirkwood: make snd_pcm_hardware const
  ASoC: sh: make snd_pcm_hardware const
  ASoC: qcom: make snd_pcm_hardware const

 sound/soc/fsl/fsl_asrc_dma.c | 2 +-
 sound/soc/fsl/imx-pcm-fiq.c  | 2 +-
 sound/soc/intel/atom/sst-mfld-platform-pcm.c | 2 +-
 sound/soc/intel/skylake/skl-pcm.c| 2 +-
 sound/soc/kirkwood/kirkwood-dma.c| 2 +-
 sound/soc/qcom/lpass-platform.c  | 2 +-
 sound/soc/sh/dma-sh7760.c| 2 +-
 sound/soc/sh/fsi.c   | 2 +-
 sound/soc/sh/rcar/core.c | 2 +-
 sound/soc/sh/siu_dai.c   | 2 +-
 10 files changed, 10 insertions(+), 10 deletions(-)

-- 
1.9.1



Re: [PATCH] staging: vboxvideo: make drm_fb_helper_funcs const

2017-08-17 Thread Bhumika Goyal
On Thu, Aug 17, 2017 at 10:33 PM, Greg KH  wrote:
> On Tue, Aug 08, 2017 at 09:15:42PM +0530, Bhumika Goyal wrote:
>> Make the structure const as it is only passed to the function
>> drm_fb_helper_prepare and the corresponding argument is of type
>> const.
>> Done using Coccinelle.
>>
>> Signed-off-by: Bhumika Goyal 
>> ---
>>  drivers/staging/vboxvideo/vbox_fb.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> Does not apply to my tree at all :(

Okay, I will resend it.

Thanks,
Bhumika


[PATCH] clk: make clk_init_data const

2017-08-18 Thread Bhumika Goyal
Make these const as they are only stored in the init field of a clk_hw
structure, which is const.

Signed-off-by: Bhumika Goyal 
---
To test changes in clk-common.c, I compiled clk-atlas6.c and clk-prima2.c
as it gets included in these two files.

 drivers/clk/clk-twl6040.c |  2 +-
 drivers/clk/clk-wm831x.c  |  6 ++--
 drivers/clk/sirf/clk-atlas6.c |  2 +-
 drivers/clk/sirf/clk-atlas7.c | 18 +-
 drivers/clk/sirf/clk-common.c | 80 +--
 drivers/clk/sirf/clk-prima2.c |  2 +-
 6 files changed, 55 insertions(+), 55 deletions(-)

diff --git a/drivers/clk/clk-twl6040.c b/drivers/clk/clk-twl6040.c
index 7b222a5..25dfe05 100644
--- a/drivers/clk/clk-twl6040.c
+++ b/drivers/clk/clk-twl6040.c
@@ -82,7 +82,7 @@ static unsigned long twl6040_pdmclk_recalc_rate(struct clk_hw 
*hw,
.recalc_rate = twl6040_pdmclk_recalc_rate,
 };
 
-static struct clk_init_data twl6040_pdmclk_init = {
+static const struct clk_init_data twl6040_pdmclk_init = {
.name = "pdmclk",
.ops = &twl6040_pdmclk_ops,
.flags = CLK_GET_RATE_NOCACHE,
diff --git a/drivers/clk/clk-wm831x.c b/drivers/clk/clk-wm831x.c
index a47960a..1467695 100644
--- a/drivers/clk/clk-wm831x.c
+++ b/drivers/clk/clk-wm831x.c
@@ -52,7 +52,7 @@ static unsigned long wm831x_xtal_recalc_rate(struct clk_hw 
*hw,
.recalc_rate = wm831x_xtal_recalc_rate,
 };
 
-static struct clk_init_data wm831x_xtal_init = {
+static const struct clk_init_data wm831x_xtal_init = {
.name = "xtal",
.ops = &wm831x_xtal_ops,
 };
@@ -225,7 +225,7 @@ static u8 wm831x_fll_get_parent(struct clk_hw *hw)
.get_parent = wm831x_fll_get_parent,
 };
 
-static struct clk_init_data wm831x_fll_init = {
+static const struct clk_init_data wm831x_fll_init = {
.name = "fll",
.ops = &wm831x_fll_ops,
.parent_names = wm831x_fll_parents,
@@ -338,7 +338,7 @@ static int wm831x_clkout_set_parent(struct clk_hw *hw, u8 
parent)
.set_parent = wm831x_clkout_set_parent,
 };
 
-static struct clk_init_data wm831x_clkout_init = {
+static const struct clk_init_data wm831x_clkout_init = {
.name = "clkout",
.ops = &wm831x_clkout_ops,
.parent_names = wm831x_clkout_parents,
diff --git a/drivers/clk/sirf/clk-atlas6.c b/drivers/clk/sirf/clk-atlas6.c
index 665fa68..0cd11e6 100644
--- a/drivers/clk/sirf/clk-atlas6.c
+++ b/drivers/clk/sirf/clk-atlas6.c
@@ -42,7 +42,7 @@
},
 };
 
-static struct clk_init_data clk_nand_init = {
+static const struct clk_init_data clk_nand_init = {
.name = "nand",
.ops = &dmn_ops,
.parent_names = dmn_clk_parents,
diff --git a/drivers/clk/sirf/clk-atlas7.c b/drivers/clk/sirf/clk-atlas7.c
index d0c6c9a..be012b4 100644
--- a/drivers/clk/sirf/clk-atlas7.c
+++ b/drivers/clk/sirf/clk-atlas7.c
@@ -392,7 +392,7 @@ static unsigned long pll_clk_recalc_rate(struct clk_hw *hw,
"xin",
 };
 
-static struct clk_init_data clk_cpupll_init = {
+static const struct clk_init_data clk_cpupll_init = {
.name = "cpupll_vco",
.ops = &ab_pll_ops,
.parent_names = pll_clk_parents,
@@ -406,7 +406,7 @@ static unsigned long pll_clk_recalc_rate(struct clk_hw *hw,
},
 };
 
-static struct clk_init_data clk_mempll_init = {
+static const struct clk_init_data clk_mempll_init = {
.name = "mempll_vco",
.ops = &ab_pll_ops,
.parent_names = pll_clk_parents,
@@ -420,7 +420,7 @@ static unsigned long pll_clk_recalc_rate(struct clk_hw *hw,
},
 };
 
-static struct clk_init_data clk_sys0pll_init = {
+static const struct clk_init_data clk_sys0pll_init = {
.name = "sys0pll_vco",
.ops = &ab_pll_ops,
.parent_names = pll_clk_parents,
@@ -434,7 +434,7 @@ static unsigned long pll_clk_recalc_rate(struct clk_hw *hw,
},
 };
 
-static struct clk_init_data clk_sys1pll_init = {
+static const struct clk_init_data clk_sys1pll_init = {
.name = "sys1pll_vco",
.ops = &ab_pll_ops,
.parent_names = pll_clk_parents,
@@ -448,7 +448,7 @@ static unsigned long pll_clk_recalc_rate(struct clk_hw *hw,
},
 };
 
-static struct clk_init_data clk_sys2pll_init = {
+static const struct clk_init_data clk_sys2pll_init = {
.name = "sys2pll_vco",
.ops = &ab_pll_ops,
.parent_names = pll_clk_parents,
@@ -462,7 +462,7 @@ static unsigned long pll_clk_recalc_rate(struct clk_hw *hw,
},
 };
 
-static struct clk_init_data clk_sys3pll_init = {
+static const struct clk_init_data clk_sys3pll_init = {
.name = "sys3pll_vco",
.ops = &ab_pll_ops,
.parent_names = pll_clk_parents,
@@ -596,7 +596,7 @@ static int dto_clk_set_parent(struct clk_hw *hw, u8 index)
"sys3pll_clk1",
 };
 
-static struct clk_init_data clk_audiodto_init = {
+static const

[PATCH 0/2] drm: constify drm_encoder_helper_funcs structures

2017-06-20 Thread Bhumika Goyal
Add const to drm_encoder_helper_funcs structures.

Bhumika Goyal (2):
  drm/rockchip: add const to drm_encoder_helper_funcs structures
  drm/sun4i: add const to drm_encoder_helper_funcs structures

 drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 3 ++-
 drivers/gpu/drm/rockchip/inno_hdmi.c| 2 +-
 drivers/gpu/drm/sun4i/sun4i_rgb.c   | 2 +-
 drivers/gpu/drm/sun4i/sun4i_tv.c| 2 +-
 4 files changed, 5 insertions(+), 4 deletions(-)

-- 
2.7.4



[PATCH 2/2] drm/sun4i: add const to drm_encoder_helper_funcs structures

2017-06-20 Thread Bhumika Goyal
Add const to drm_encoder_helper_funcs structures as they are only passed
as an argument to the function drm_encoder_helper_add and this argument
is of type const. So, add const to these structures.

Signed-off-by: Bhumika Goyal 
---
 drivers/gpu/drm/sun4i/sun4i_rgb.c | 2 +-
 drivers/gpu/drm/sun4i/sun4i_tv.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/sun4i/sun4i_rgb.c 
b/drivers/gpu/drm/sun4i/sun4i_rgb.c
index 422b191..67847d2 100644
--- a/drivers/gpu/drm/sun4i/sun4i_rgb.c
+++ b/drivers/gpu/drm/sun4i/sun4i_rgb.c
@@ -181,7 +181,7 @@ static void sun4i_rgb_encoder_mode_set(struct drm_encoder 
*encoder,
clk_set_phase(tcon->dclk, 120);
 }
 
-static struct drm_encoder_helper_funcs sun4i_rgb_enc_helper_funcs = {
+static const struct drm_encoder_helper_funcs sun4i_rgb_enc_helper_funcs = {
.atomic_check   = sun4i_rgb_atomic_check,
.mode_set   = sun4i_rgb_encoder_mode_set,
.disable= sun4i_rgb_encoder_disable,
diff --git a/drivers/gpu/drm/sun4i/sun4i_tv.c b/drivers/gpu/drm/sun4i/sun4i_tv.c
index 338b9e5..b20f97a 100644
--- a/drivers/gpu/drm/sun4i/sun4i_tv.c
+++ b/drivers/gpu/drm/sun4i/sun4i_tv.c
@@ -488,7 +488,7 @@ static void sun4i_tv_mode_set(struct drm_encoder *encoder,
regmap_write(tv->regs, SUN4I_TVE_SLAVE_REG, 0);
 }
 
-static struct drm_encoder_helper_funcs sun4i_tv_helper_funcs = {
+static const struct drm_encoder_helper_funcs sun4i_tv_helper_funcs = {
.atomic_check   = sun4i_tv_atomic_check,
.disable= sun4i_tv_disable,
.enable = sun4i_tv_enable,
-- 
2.7.4



[PATCH 1/2] drm/rockchip: add const to drm_encoder_helper_funcs structures

2017-06-20 Thread Bhumika Goyal
Add const to drm_encoder_helper_funcs structures as they are only passed
as an argument to the function drm_encoder_helper_add and this argument
is of type const. So, add const to these structures. Also, fix line over
80 characters warning while adding const.

Signed-off-by: Bhumika Goyal 
---
 drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 3 ++-
 drivers/gpu/drm/rockchip/inno_hdmi.c| 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c 
b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
index 9606121..96c6c10 100644
--- a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
+++ b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
@@ -252,7 +252,8 @@ rockchip_dp_drm_encoder_atomic_check(struct drm_encoder 
*encoder,
return 0;
 }
 
-static struct drm_encoder_helper_funcs rockchip_dp_encoder_helper_funcs = {
+static
+const struct drm_encoder_helper_funcs rockchip_dp_encoder_helper_funcs = {
.mode_fixup = rockchip_dp_drm_encoder_mode_fixup,
.mode_set = rockchip_dp_drm_encoder_mode_set,
.enable = rockchip_dp_drm_encoder_enable,
diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c 
b/drivers/gpu/drm/rockchip/inno_hdmi.c
index 7d9b75e..4ab9fad 100644
--- a/drivers/gpu/drm/rockchip/inno_hdmi.c
+++ b/drivers/gpu/drm/rockchip/inno_hdmi.c
@@ -530,7 +530,7 @@ inno_hdmi_encoder_atomic_check(struct drm_encoder *encoder,
return 0;
 }
 
-static struct drm_encoder_helper_funcs inno_hdmi_encoder_helper_funcs = {
+static const struct drm_encoder_helper_funcs inno_hdmi_encoder_helper_funcs = {
.enable = inno_hdmi_encoder_enable,
.disable= inno_hdmi_encoder_disable,
.mode_fixup = inno_hdmi_encoder_mode_fixup,
-- 
2.7.4



Re: [PATCH 1/2] drm/rockchip: add const to drm_encoder_helper_funcs structures

2017-06-20 Thread Bhumika Goyal
On Wed, Jun 21, 2017 at 6:18 AM, Mark yao  wrote:
> On 2017年06月20日 21:07, Bhumika Goyal wrote:
>>
>> Add const to drm_encoder_helper_funcs structures as they are only passed
>> as an argument to the function drm_encoder_helper_add and this argument
>> is of type const. So, add const to these structures. Also, fix line over
>> 80 characters warning while adding const.
>>
>> Signed-off-by: Bhumika Goyal 
>> ---
>>   drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 3 ++-
>>   drivers/gpu/drm/rockchip/inno_hdmi.c| 2 +-
>>   2 files changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
>> b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
>> index 9606121..96c6c10 100644
>> --- a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
>> +++ b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
>> @@ -252,7 +252,8 @@ rockchip_dp_drm_encoder_atomic_check(struct
>> drm_encoder *encoder,
>> return 0;
>>   }
>>   -static struct drm_encoder_helper_funcs rockchip_dp_encoder_helper_funcs
>> = {
>> +static
>> +const struct drm_encoder_helper_funcs rockchip_dp_encoder_helper_funcs =
>> {
>
>
> I don't think split static and const into two line is a good idea, it's
> ugly. I'm ok over 80 characters with good-looking.
> Or split like following:
> static const struct drm_encoder_helper_funcs
> rockchip_dp_encoder_helper_funcs = {
>

Okay, so I will let the line exceed over 80 characters and send a v2.

Thanks,
Bhumika

>> .mode_fixup = rockchip_dp_drm_encoder_mode_fixup,
>> .mode_set = rockchip_dp_drm_encoder_mode_set,
>> .enable = rockchip_dp_drm_encoder_enable,
>> diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c
>> b/drivers/gpu/drm/rockchip/inno_hdmi.c
>> index 7d9b75e..4ab9fad 100644
>> --- a/drivers/gpu/drm/rockchip/inno_hdmi.c
>> +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c
>> @@ -530,7 +530,7 @@ inno_hdmi_encoder_atomic_check(struct drm_encoder
>> *encoder,
>> return 0;
>>   }
>>   -static struct drm_encoder_helper_funcs inno_hdmi_encoder_helper_funcs =
>> {
>> +static const struct drm_encoder_helper_funcs
>> inno_hdmi_encoder_helper_funcs = {
>> .enable = inno_hdmi_encoder_enable,
>> .disable= inno_hdmi_encoder_disable,
>> .mode_fixup = inno_hdmi_encoder_mode_fixup,
>
>
> Thanks
>
> --
> ï¼­ark Yao
>
>


[PATCH v2 0/2] drm: constify drm_encoder_helper_funcs structures

2017-06-20 Thread Bhumika Goyal
Add const to drm_encoder_helper_funcs structures.

Changes in v2 -
* Let the line exceed over 80 characters while adding const
in analogix_dp-rockchip.c file.

Bhumika Goyal (2):
  drm/rockchip: add const to drm_encoder_helper_funcs structures
  drm/sun4i: add const to drm_encoder_helper_funcs structures

 drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 2 +-
 drivers/gpu/drm/rockchip/inno_hdmi.c| 2 +-
 drivers/gpu/drm/sun4i/sun4i_rgb.c   | 2 +-
 drivers/gpu/drm/sun4i/sun4i_tv.c| 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

-- 
2.7.4



[PATCH v2 1/2] drm/rockchip: add const to drm_encoder_helper_funcs structures

2017-06-20 Thread Bhumika Goyal
Add const to drm_encoder_helper_funcs structures as they are only passed
as an argument to the function drm_encoder_helper_add and this argument
is of type const. So, add const to these structures.

Signed-off-by: Bhumika Goyal 
---
Changes in v2 -
* Let the line exceed over 80 characters while adding const.

 drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 2 +-
 drivers/gpu/drm/rockchip/inno_hdmi.c| 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c 
b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
index 9606121..b64cadc 100644
--- a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
+++ b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
@@ -252,7 +252,7 @@ rockchip_dp_drm_encoder_atomic_check(struct drm_encoder 
*encoder,
return 0;
 }
 
-static struct drm_encoder_helper_funcs rockchip_dp_encoder_helper_funcs = {
+static const struct drm_encoder_helper_funcs rockchip_dp_encoder_helper_funcs 
= {
.mode_fixup = rockchip_dp_drm_encoder_mode_fixup,
.mode_set = rockchip_dp_drm_encoder_mode_set,
.enable = rockchip_dp_drm_encoder_enable,
diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c 
b/drivers/gpu/drm/rockchip/inno_hdmi.c
index 7d9b75e..4ab9fad 100644
--- a/drivers/gpu/drm/rockchip/inno_hdmi.c
+++ b/drivers/gpu/drm/rockchip/inno_hdmi.c
@@ -530,7 +530,7 @@ inno_hdmi_encoder_atomic_check(struct drm_encoder *encoder,
return 0;
 }
 
-static struct drm_encoder_helper_funcs inno_hdmi_encoder_helper_funcs = {
+static const struct drm_encoder_helper_funcs inno_hdmi_encoder_helper_funcs = {
.enable = inno_hdmi_encoder_enable,
.disable= inno_hdmi_encoder_disable,
.mode_fixup = inno_hdmi_encoder_mode_fixup,
-- 
2.7.4



[PATCH v2 2/2] drm/sun4i: add const to drm_encoder_helper_funcs structures

2017-06-20 Thread Bhumika Goyal
Add const to drm_encoder_helper_funcs structures as they are only passed
as an argument to the function drm_encoder_helper_add and this argument
is of type const. So, add const to these structures.

Signed-off-by: Bhumika Goyal 
---
Changes in v2 -
* No change

 drivers/gpu/drm/sun4i/sun4i_rgb.c | 2 +-
 drivers/gpu/drm/sun4i/sun4i_tv.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/sun4i/sun4i_rgb.c 
b/drivers/gpu/drm/sun4i/sun4i_rgb.c
index 422b191..67847d2 100644
--- a/drivers/gpu/drm/sun4i/sun4i_rgb.c
+++ b/drivers/gpu/drm/sun4i/sun4i_rgb.c
@@ -181,7 +181,7 @@ static void sun4i_rgb_encoder_mode_set(struct drm_encoder 
*encoder,
clk_set_phase(tcon->dclk, 120);
 }
 
-static struct drm_encoder_helper_funcs sun4i_rgb_enc_helper_funcs = {
+static const struct drm_encoder_helper_funcs sun4i_rgb_enc_helper_funcs = {
.atomic_check   = sun4i_rgb_atomic_check,
.mode_set   = sun4i_rgb_encoder_mode_set,
.disable= sun4i_rgb_encoder_disable,
diff --git a/drivers/gpu/drm/sun4i/sun4i_tv.c b/drivers/gpu/drm/sun4i/sun4i_tv.c
index 338b9e5..b20f97a 100644
--- a/drivers/gpu/drm/sun4i/sun4i_tv.c
+++ b/drivers/gpu/drm/sun4i/sun4i_tv.c
@@ -488,7 +488,7 @@ static void sun4i_tv_mode_set(struct drm_encoder *encoder,
regmap_write(tv->regs, SUN4I_TVE_SLAVE_REG, 0);
 }
 
-static struct drm_encoder_helper_funcs sun4i_tv_helper_funcs = {
+static const struct drm_encoder_helper_funcs sun4i_tv_helper_funcs = {
.atomic_check   = sun4i_tv_atomic_check,
.disable= sun4i_tv_disable,
.enable = sun4i_tv_enable,
-- 
2.7.4



[PATCH 0/2] platform/x86: add const to thermal_cooling_device_ops structures

2017-06-21 Thread Bhumika Goyal
Declare thermal_cooling_device_ops structures as const.

Bhumika Goyal (2):
  acerhdf: add const to thermal_cooling_device_ops structure
  intel_menlow: add const to thermal_cooling_device_ops structure

 drivers/platform/x86/acerhdf.c  | 2 +-
 drivers/platform/x86/intel_menlow.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

-- 
2.7.4



[PATCH 2/2] intel_menlow: add const to thermal_cooling_device_ops structure

2017-06-21 Thread Bhumika Goyal
Declare thermal_cooling_device_ops structure as const as it is only passed
as an argument to the function thermal_cooling_device_register and this
argument is of type const. So, declare the structure as const.

Signed-off-by: Bhumika Goyal 
---
 drivers/platform/x86/intel_menlow.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/platform/x86/intel_menlow.c 
b/drivers/platform/x86/intel_menlow.c
index cbe0102..ef9b0af 100644
--- a/drivers/platform/x86/intel_menlow.c
+++ b/drivers/platform/x86/intel_menlow.c
@@ -142,7 +142,7 @@ static int memory_set_cur_bandwidth(struct 
thermal_cooling_device *cdev,
return 0;
 }
 
-static struct thermal_cooling_device_ops memory_cooling_ops = {
+static const struct thermal_cooling_device_ops memory_cooling_ops = {
.get_max_state = memory_get_max_bandwidth,
.get_cur_state = memory_get_cur_bandwidth,
.set_cur_state = memory_set_cur_bandwidth,
-- 
2.7.4



[PATCH 1/2] acerhdf: add const to thermal_cooling_device_ops structure

2017-06-21 Thread Bhumika Goyal
Declare thermal_cooling_device_ops structure as const as it is only passed
as an argument to the function thermal_cooling_device_register and this
argument is of type const. So, declare the structure as const.

Signed-off-by: Bhumika Goyal 
---
 drivers/platform/x86/acerhdf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/platform/x86/acerhdf.c b/drivers/platform/x86/acerhdf.c
index 2acdb0d..ea22591 100644
--- a/drivers/platform/x86/acerhdf.c
+++ b/drivers/platform/x86/acerhdf.c
@@ -557,7 +557,7 @@ static int acerhdf_set_cur_state(struct 
thermal_cooling_device *cdev,
 }
 
 /* bind fan callbacks to fan device */
-static struct thermal_cooling_device_ops acerhdf_cooling_ops = {
+static const struct thermal_cooling_device_ops acerhdf_cooling_ops = {
.get_max_state = acerhdf_get_max_state,
.get_cur_state = acerhdf_get_cur_state,
.set_cur_state = acerhdf_set_cur_state,
-- 
2.7.4



[PATCH] thermal/intel_powerclamp: add const to thermal_cooling_device_ops structure

2017-06-21 Thread Bhumika Goyal
Declare thermal_cooling_device_ops structure as const as it is only passed
as an argument to the function thermal_cooling_device_register and this
argument is of type const. So, declare the structure as const.

Signed-off-by: Bhumika Goyal 
---
 drivers/thermal/intel_powerclamp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thermal/intel_powerclamp.c 
b/drivers/thermal/intel_powerclamp.c
index d718cd1..e4c68b7 100644
--- a/drivers/thermal/intel_powerclamp.c
+++ b/drivers/thermal/intel_powerclamp.c
@@ -659,7 +659,7 @@ static int powerclamp_set_cur_state(struct 
thermal_cooling_device *cdev,
 }
 
 /* bind to generic thermal layer as cooling device*/
-static struct thermal_cooling_device_ops powerclamp_cooling_ops = {
+static const struct thermal_cooling_device_ops powerclamp_cooling_ops = {
.get_max_state = powerclamp_get_max_state,
.get_cur_state = powerclamp_get_cur_state,
.set_cur_state = powerclamp_set_cur_state,
-- 
2.7.4



[PATCH] iwlwifi: mvm: add const to thermal_cooling_device_ops structure

2017-06-21 Thread Bhumika Goyal
Declare thermal_cooling_device_ops structure as const as it is only passed
as an argument to the function thermal_cooling_device_register and this
argument is of type const. So, declare the structure as const.

Signed-off-by: Bhumika Goyal 
---
 drivers/net/wireless/intel/iwlwifi/mvm/tt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/tt.c 
b/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
index 453a785..0b5a177 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
@@ -813,7 +813,7 @@ static int iwl_mvm_tcool_set_cur_state(struct 
thermal_cooling_device *cdev,
return ret;
 }
 
-static struct thermal_cooling_device_ops tcooling_ops = {
+static const struct thermal_cooling_device_ops tcooling_ops = {
.get_max_state = iwl_mvm_tcool_get_max_state,
.get_cur_state = iwl_mvm_tcool_get_cur_state,
.set_cur_state = iwl_mvm_tcool_set_cur_state,
-- 
2.7.4



[PATCH] ath10k: add const to thermal_cooling_device_ops structure

2017-06-21 Thread Bhumika Goyal
Declare thermal_cooling_device_ops structure as const as it is only passed
as an argument to the function thermal_cooling_device_register and this
argument is of type const. So, declare the structure as const.

Signed-off-by: Bhumika Goyal 
---
 drivers/net/wireless/ath/ath10k/thermal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath10k/thermal.c 
b/drivers/net/wireless/ath/ath10k/thermal.c
index 87948af..ef717b6 100644
--- a/drivers/net/wireless/ath/ath10k/thermal.c
+++ b/drivers/net/wireless/ath/ath10k/thermal.c
@@ -63,7 +63,7 @@ ath10k_thermal_set_cur_throttle_state(struct 
thermal_cooling_device *cdev,
return 0;
 }
 
-static struct thermal_cooling_device_ops ath10k_thermal_ops = {
+static const struct thermal_cooling_device_ops ath10k_thermal_ops = {
.get_max_state = ath10k_thermal_get_max_throttle_state,
.get_cur_state = ath10k_thermal_get_cur_throttle_state,
.set_cur_state = ath10k_thermal_set_cur_throttle_state,
-- 
2.7.4



[PATCH] drm/etnaviv: add const to thermal_cooling_device_ops structure

2017-06-21 Thread Bhumika Goyal
Declare thermal_cooling_device_ops structure as const as it is only passed
as an argument to the function thermal_of_cooling_device_register and this
argument is of type const. So, declare the structure as const.

Signed-off-by: Bhumika Goyal 
---
 drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c 
b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
index ada45fd..cfa9cfc 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
@@ -1608,7 +1608,7 @@ etnaviv_gpu_cooling_set_cur_state(struct 
thermal_cooling_device *cdev,
return 0;
 }
 
-static struct thermal_cooling_device_ops cooling_ops = {
+static const struct thermal_cooling_device_ops cooling_ops = {
.get_max_state = etnaviv_gpu_cooling_get_max_state,
.get_cur_state = etnaviv_gpu_cooling_get_cur_state,
.set_cur_state = etnaviv_gpu_cooling_set_cur_state,
-- 
2.7.4



[PATCH 1/2] ARM: davinci: make the function argument as const

2017-10-16 Thread Bhumika Goyal
Make the function argument of the function davinci_common_init
as const as it's memory contents are only copied during a
memcpy call. So, the fields of the structure to which the argument
soc_info points to never gets modified and therefore the argument can
be made const.
Add const to the prototype too.

Signed-off-by: Bhumika Goyal 
---
 arch/arm/mach-davinci/common.c  | 2 +-
 arch/arm/mach-davinci/include/mach/common.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-davinci/common.c b/arch/arm/mach-davinci/common.c
index 9f9fbfa..bcb6a7b 100644
--- a/arch/arm/mach-davinci/common.c
+++ b/arch/arm/mach-davinci/common.c
@@ -77,7 +77,7 @@ static int __init davinci_init_id(struct davinci_soc_info 
*soc_info)
return -EINVAL;
 }
 
-void __init davinci_common_init(struct davinci_soc_info *soc_info)
+void __init davinci_common_init(const struct davinci_soc_info *soc_info)
 {
int ret;
 
diff --git a/arch/arm/mach-davinci/include/mach/common.h 
b/arch/arm/mach-davinci/include/mach/common.h
index 037aa66..433a008 100644
--- a/arch/arm/mach-davinci/include/mach/common.h
+++ b/arch/arm/mach-davinci/include/mach/common.h
@@ -79,7 +79,7 @@ struct davinci_soc_info {
 
 extern struct davinci_soc_info davinci_soc_info;
 
-extern void davinci_common_init(struct davinci_soc_info *soc_info);
+extern void davinci_common_init(const struct davinci_soc_info *soc_info);
 extern void davinci_init_ide(void);
 void davinci_restart(enum reboot_mode mode, const char *cmd);
 void davinci_init_late(void);
-- 
1.9.1



[PATCH 2/2] ARM: davinci: make davinci_soc_info structures const

2017-10-16 Thread Bhumika Goyal
This is a followup patch for [PATCH 1/2].

Make the structures const as they are either passed to the function
davinci_common_init having the argument as const or their field cpu_clks
of type struct clk_lookup * is passed to the function davinci_clk_init.
So, the fields are never modified and the structures can be const. 

Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 arch/arm/mach-davinci/da830.c  | 2 +-
 arch/arm/mach-davinci/da850.c  | 2 +-
 arch/arm/mach-davinci/dm355.c  | 2 +-
 arch/arm/mach-davinci/dm365.c  | 2 +-
 arch/arm/mach-davinci/dm644x.c | 2 +-
 arch/arm/mach-davinci/dm646x.c | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-davinci/da830.c b/arch/arm/mach-davinci/da830.c
index bd88470..ed0b700 100644
--- a/arch/arm/mach-davinci/da830.c
+++ b/arch/arm/mach-davinci/da830.c
@@ -1194,7 +1194,7 @@ int __init da830_register_gpio(void)
.clocksource_id = T0_BOT,
 };
 
-static struct davinci_soc_info davinci_soc_info_da830 = {
+static const struct davinci_soc_info davinci_soc_info_da830 = {
.io_desc= da830_io_desc,
.io_desc_num= ARRAY_SIZE(da830_io_desc),
.jtag_id_reg= DA8XX_SYSCFG0_BASE + DA8XX_JTAG_ID_REG,
diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c
index 07d6f0e..04a58a3 100644
--- a/arch/arm/mach-davinci/da850.c
+++ b/arch/arm/mach-davinci/da850.c
@@ -1347,7 +1347,7 @@ int __init da850_register_gpio(void)
return da8xx_register_gpio(&da850_gpio_platform_data);
 }
 
-static struct davinci_soc_info davinci_soc_info_da850 = {
+static const struct davinci_soc_info davinci_soc_info_da850 = {
.io_desc= da850_io_desc,
.io_desc_num= ARRAY_SIZE(da850_io_desc),
.jtag_id_reg= DA8XX_SYSCFG0_BASE + DA8XX_JTAG_ID_REG,
diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c
index bd50367..938747f 100644
--- a/arch/arm/mach-davinci/dm355.c
+++ b/arch/arm/mach-davinci/dm355.c
@@ -1006,7 +1006,7 @@ struct platform_device dm355_serial_device[] = {
}
 };
 
-static struct davinci_soc_info davinci_soc_info_dm355 = {
+static const struct davinci_soc_info davinci_soc_info_dm355 = {
.io_desc= dm355_io_desc,
.io_desc_num= ARRAY_SIZE(dm355_io_desc),
.jtag_id_reg= 0x01c40028,
diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c
index 8be04ec..bcf1494 100644
--- a/arch/arm/mach-davinci/dm365.c
+++ b/arch/arm/mach-davinci/dm365.c
@@ -1108,7 +1108,7 @@ struct platform_device dm365_serial_device[] = {
}
 };
 
-static struct davinci_soc_info davinci_soc_info_dm365 = {
+static const struct davinci_soc_info davinci_soc_info_dm365 = {
.io_desc= dm365_io_desc,
.io_desc_num= ARRAY_SIZE(dm365_io_desc),
.jtag_id_reg= 0x01c40028,
diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c
index b437c37..6b41e1c 100644
--- a/arch/arm/mach-davinci/dm644x.c
+++ b/arch/arm/mach-davinci/dm644x.c
@@ -899,7 +899,7 @@ struct platform_device dm644x_serial_device[] = {
}
 };
 
-static struct davinci_soc_info davinci_soc_info_dm644x = {
+static const struct davinci_soc_info davinci_soc_info_dm644x = {
.io_desc= dm644x_io_desc,
.io_desc_num= ARRAY_SIZE(dm644x_io_desc),
.jtag_id_reg= 0x01c40028,
diff --git a/arch/arm/mach-davinci/dm646x.c b/arch/arm/mach-davinci/dm646x.c
index da21353..b72e04a 100644
--- a/arch/arm/mach-davinci/dm646x.c
+++ b/arch/arm/mach-davinci/dm646x.c
@@ -882,7 +882,7 @@ struct platform_device dm646x_serial_device[] = {
}
 };
 
-static struct davinci_soc_info davinci_soc_info_dm646x = {
+static const struct davinci_soc_info davinci_soc_info_dm646x = {
.io_desc= dm646x_io_desc,
.io_desc_num= ARRAY_SIZE(dm646x_io_desc),
.jtag_id_reg= 0x01c40028,
-- 
1.9.1



[PATCH 0/2] ARM: davinci: make function argument and structure const

2017-10-16 Thread Bhumika Goyal
Make the function argument of davinci_common_init const. 
After doing this change make the structures davinci_soc_info const.

Bhumika Goyal (2):
  ARM: davinci: make the function argument as const
  ARM: davinci: make davinci_soc_info structures const

 arch/arm/mach-davinci/common.c  | 2 +-
 arch/arm/mach-davinci/da830.c   | 2 +-
 arch/arm/mach-davinci/da850.c   | 2 +-
 arch/arm/mach-davinci/dm355.c   | 2 +-
 arch/arm/mach-davinci/dm365.c   | 2 +-
 arch/arm/mach-davinci/dm644x.c  | 2 +-
 arch/arm/mach-davinci/dm646x.c  | 2 +-
 arch/arm/mach-davinci/include/mach/common.h | 2 +-
 8 files changed, 8 insertions(+), 8 deletions(-)

-- 
1.9.1



Re: [PATCH] stm class: make config_item_type const

2017-10-16 Thread Bhumika Goyal
On Mon, Oct 16, 2017 at 1:55 PM, Alexander Shishkin
 wrote:
> Bhumika Goyal  writes:
>
>> On Thu, Oct 12, 2017 at 2:12 PM, Bhumika Goyal  wrote:
>>> This is a followup patch for:
>>> https://patchwork.kernel.org/patch/649/ and
>>> https://lkml.org/lkml/2017/10/11/375
>>>
>>> Make config_item_type structures const as they are either passed to a
>>> function having the argument as const or used inside a if statement or
>>> stored in the const "ci_type" field of a config_item structure.
>>>
>>> Done using Coccinelle.
>>>
>>
>> Tthis patch is dependent on the patches in the links
>> https://lkml.org/lkml/2017/10/11/375 and
>> https://patchwork.kernel.org/patch/649/. Therefore, this patch
>> won't be correct unless the patches in these links gets applied.
>
> So why not send it as a series then?
>

I will re-send all the changes in a series.

Thanks,
Bhumika

> Regards,
> --
> Alex


Re: [PATCH] configfs: make config_item_type const

2017-10-16 Thread Bhumika Goyal
On Mon, Oct 16, 2017 at 2:43 PM, Christoph Hellwig  wrote:
> On Thu, Oct 12, 2017 at 05:02:43PM +0200, Bhumika Goyal wrote:
>> Actually, this patch is dependent on the patches in the links
>> https://lkml.org/lkml/2017/10/11/375 and
>> https://patchwork.kernel.org/patch/649/. Therefore, this patch
>> won't be correct unless the patches in these links gets applied.
>
> Please send all the configfs-related constification patches to me and
> linux-fsdevel in a single series, and I will apply them to the configfs
> tree after some time to give the various maintainers a chance to review
> them.


Thanks! I will re-send them in a series.

Thanks,
Bhumika


[PATCH v2 15/15] configfs: make config_item_type const

2017-10-16 Thread Bhumika Goyal
Make config_item_type structures const as they are either passed to a
function having the argument as const or stored in the const "ci_type"
field of a config_item structure.

Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
* Changes in v2- Combine all the followup patches and the constification
patches into a series.

 samples/configfs/configfs_sample.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/samples/configfs/configfs_sample.c 
b/samples/configfs/configfs_sample.c
index 1ea3311..004a4e2 100644
--- a/samples/configfs/configfs_sample.c
+++ b/samples/configfs/configfs_sample.c
@@ -115,7 +115,7 @@ static ssize_t childless_description_show(struct 
config_item *item, char *page)
NULL,
 };
 
-static struct config_item_type childless_type = {
+static const struct config_item_type childless_type = {
.ct_attrs   = childless_attrs,
.ct_owner   = THIS_MODULE,
 };
@@ -193,7 +193,7 @@ static void simple_child_release(struct config_item *item)
.release= simple_child_release,
 };
 
-static struct config_item_type simple_child_type = {
+static const struct config_item_type simple_child_type = {
.ct_item_ops= &simple_child_item_ops,
.ct_attrs   = simple_child_attrs,
.ct_owner   = THIS_MODULE,
@@ -261,7 +261,7 @@ static void simple_children_release(struct config_item 
*item)
.make_item  = simple_children_make_item,
 };
 
-static struct config_item_type simple_children_type = {
+static const struct config_item_type simple_children_type = {
.ct_item_ops= &simple_children_item_ops,
.ct_group_ops   = &simple_children_group_ops,
.ct_attrs   = simple_children_attrs,
@@ -331,7 +331,7 @@ static ssize_t group_children_description_show(struct 
config_item *item,
.make_group = group_children_make_group,
 };
 
-static struct config_item_type group_children_type = {
+static const struct config_item_type group_children_type = {
.ct_group_ops   = &group_children_group_ops,
.ct_attrs   = group_children_attrs,
.ct_owner   = THIS_MODULE,
-- 
1.9.1



[PATCH v2 14/15] dlm: make config_item_type const

2017-10-16 Thread Bhumika Goyal
Make config_item_type structures const as they are either passed to a
function having the argument as const or stored in the const "ci_type"
field of a config_item structure.

Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
* Changes in v2- Combine all the followup patches and the constification
patches into a series.

 fs/dlm/config.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/fs/dlm/config.c b/fs/dlm/config.c
index 7211e82..1270551 100644
--- a/fs/dlm/config.c
+++ b/fs/dlm/config.c
@@ -282,44 +282,44 @@ struct dlm_node {
.release = release_node,
 };
 
-static struct config_item_type clusters_type = {
+static const struct config_item_type clusters_type = {
.ct_group_ops = &clusters_ops,
.ct_owner = THIS_MODULE,
 };
 
-static struct config_item_type cluster_type = {
+static const struct config_item_type cluster_type = {
.ct_item_ops = &cluster_ops,
.ct_attrs = cluster_attrs,
.ct_owner = THIS_MODULE,
 };
 
-static struct config_item_type spaces_type = {
+static const struct config_item_type spaces_type = {
.ct_group_ops = &spaces_ops,
.ct_owner = THIS_MODULE,
 };
 
-static struct config_item_type space_type = {
+static const struct config_item_type space_type = {
.ct_item_ops = &space_ops,
.ct_owner = THIS_MODULE,
 };
 
-static struct config_item_type comms_type = {
+static const struct config_item_type comms_type = {
.ct_group_ops = &comms_ops,
.ct_owner = THIS_MODULE,
 };
 
-static struct config_item_type comm_type = {
+static const struct config_item_type comm_type = {
.ct_item_ops = &comm_ops,
.ct_attrs = comm_attrs,
.ct_owner = THIS_MODULE,
 };
 
-static struct config_item_type nodes_type = {
+static const struct config_item_type nodes_type = {
.ct_group_ops = &nodes_ops,
.ct_owner = THIS_MODULE,
 };
 
-static struct config_item_type node_type = {
+static const struct config_item_type node_type = {
.ct_item_ops = &node_ops,
.ct_attrs = node_attrs,
.ct_owner = THIS_MODULE,
-- 
1.9.1



[PATCH v2 13/15] netconsole: make config_item_type const

2017-10-16 Thread Bhumika Goyal
Make these structures const as they are either passed to the functions
having the argument as const or stored as a reference in the "ci_type"
const field of a config_item structure.

Done using Coccienlle.

Signed-off-by: Bhumika Goyal 
---
* Changes in v2- Combine all the followup patches and the constification
patches into a series.

 drivers/net/netconsole.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
index 0e27920..be9aa36 100644
--- a/drivers/net/netconsole.c
+++ b/drivers/net/netconsole.c
@@ -616,7 +616,7 @@ static void netconsole_target_release(struct config_item 
*item)
.release= netconsole_target_release,
 };
 
-static struct config_item_type netconsole_target_type = {
+static const struct config_item_type netconsole_target_type = {
.ct_attrs   = netconsole_target_attrs,
.ct_item_ops= &netconsole_target_item_ops,
.ct_owner   = THIS_MODULE,
@@ -682,7 +682,7 @@ static void drop_netconsole_target(struct config_group 
*group,
.drop_item  = drop_netconsole_target,
 };
 
-static struct config_item_type netconsole_subsys_type = {
+static const struct config_item_type netconsole_subsys_type = {
.ct_group_ops   = &netconsole_subsys_group_ops,
.ct_owner   = THIS_MODULE,
 };
-- 
1.9.1



[PATCH v2 11/15] stm class: make config_item_type const

2017-10-16 Thread Bhumika Goyal
Make config_item_type structures const as they are either passed to a
function having the argument as const or used inside a if statement or
stored in the const "ci_type" field of a config_item structure.

Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
* Changes in v2- Combine all the followup patches and the constification
patches into a series.

 drivers/hwtracing/stm/policy.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/hwtracing/stm/policy.c b/drivers/hwtracing/stm/policy.c
index 6c0ae29..33e9a1b 100644
--- a/drivers/hwtracing/stm/policy.c
+++ b/drivers/hwtracing/stm/policy.c
@@ -187,8 +187,8 @@ static void stp_policy_node_release(struct config_item 
*item)
NULL,
 };
 
-static struct config_item_type stp_policy_type;
-static struct config_item_type stp_policy_node_type;
+static const struct config_item_type stp_policy_type;
+static const struct config_item_type stp_policy_node_type;
 
 static struct config_group *
 stp_policy_node_make(struct config_group *group, const char *name)
@@ -236,7 +236,7 @@ static void stp_policy_node_release(struct config_item 
*item)
.drop_item  = stp_policy_node_drop,
 };
 
-static struct config_item_type stp_policy_node_type = {
+static const struct config_item_type stp_policy_node_type = {
.ct_item_ops= &stp_policy_node_item_ops,
.ct_group_ops   = &stp_policy_node_group_ops,
.ct_attrs   = stp_policy_node_attrs,
@@ -311,7 +311,7 @@ static void stp_policy_release(struct config_item *item)
.make_group = stp_policy_node_make,
 };
 
-static struct config_item_type stp_policy_type = {
+static const struct config_item_type stp_policy_type = {
.ct_item_ops= &stp_policy_item_ops,
.ct_group_ops   = &stp_policy_group_ops,
.ct_attrs   = stp_policy_attrs,
@@ -380,7 +380,7 @@ static void stp_policy_release(struct config_item *item)
.make_group = stp_policies_make,
 };
 
-static struct config_item_type stp_policies_type = {
+static const struct config_item_type stp_policies_type = {
.ct_group_ops   = &stp_policies_group_ops,
.ct_owner   = THIS_MODULE,
 };
-- 
1.9.1



[PATCH v2 12/15] RDMA/cma: make config_item_type const

2017-10-16 Thread Bhumika Goyal
Make these structures const as they are either passed to the functions
having the argument as const or stored as a reference in the "ci_type"
const field of a config_item structure.

Signed-off-by: Bhumika Goyal 
---
* Changes in v2- Combine all the followup patches and the constification
patches into a series.

 drivers/infiniband/core/cma_configfs.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/infiniband/core/cma_configfs.c 
b/drivers/infiniband/core/cma_configfs.c
index 54076a3..31dfee0 100644
--- a/drivers/infiniband/core/cma_configfs.c
+++ b/drivers/infiniband/core/cma_configfs.c
@@ -186,7 +186,7 @@ static ssize_t default_roce_tos_store(struct config_item 
*item,
NULL,
 };
 
-static struct config_item_type cma_port_group_type = {
+static const struct config_item_type cma_port_group_type = {
.ct_attrs   = cma_configfs_attributes,
.ct_owner   = THIS_MODULE
 };
@@ -263,7 +263,7 @@ static void release_cma_ports_group(struct config_item  
*item)
.release = release_cma_ports_group
 };
 
-static struct config_item_type cma_ports_group_type = {
+static const struct config_item_type cma_ports_group_type = {
.ct_item_ops= &cma_ports_item_ops,
.ct_owner   = THIS_MODULE
 };
@@ -272,7 +272,7 @@ static void release_cma_ports_group(struct config_item  
*item)
.release = release_cma_dev
 };
 
-static struct config_item_type cma_device_group_type = {
+static const struct config_item_type cma_device_group_type = {
.ct_item_ops= &cma_device_item_ops,
.ct_owner   = THIS_MODULE
 };
@@ -323,7 +323,7 @@ static struct config_group *make_cma_dev(struct 
config_group *group,
.make_group = make_cma_dev,
 };
 
-static struct config_item_type cma_subsys_type = {
+static const struct config_item_type cma_subsys_type = {
.ct_group_ops   = &cma_subsys_group_ops,
.ct_owner   = THIS_MODULE,
 };
-- 
1.9.1



[PATCH v2 10/15] nullb: make config_item_type const

2017-10-16 Thread Bhumika Goyal
Make these structures const as they are either passed to the functions
having the argument as const or stored as a reference in the "ci_type"
const field of a config_item structure.

Done using Coccienlle.

Signed-off-by: Bhumika Goyal 
---
* Changes in v2- Combine all the followup patches and the constification
patches into a series.

 drivers/block/null_blk.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/block/null_blk.c b/drivers/block/null_blk.c
index bf2c8ca..46b6008 100644
--- a/drivers/block/null_blk.c
+++ b/drivers/block/null_blk.c
@@ -480,7 +480,7 @@ static void nullb_device_release(struct config_item *item)
.release= nullb_device_release,
 };
 
-static struct config_item_type nullb_device_type = {
+static const struct config_item_type nullb_device_type = {
.ct_item_ops= &nullb_device_ops,
.ct_attrs   = nullb_device_attrs,
.ct_owner   = THIS_MODULE,
@@ -532,7 +532,7 @@ static ssize_t memb_group_features_show(struct config_item 
*item, char *page)
.drop_item  = nullb_group_drop_item,
 };
 
-static struct config_item_type nullb_group_type = {
+static const struct config_item_type nullb_group_type = {
.ct_group_ops   = &nullb_group_ops,
.ct_attrs   = nullb_group_attrs,
.ct_owner   = THIS_MODULE,
-- 
1.9.1



[PATCH v2 09/15] ACPI: configfs: make config_item_type const

2017-10-16 Thread Bhumika Goyal
Make these structures const as they are either passed to the functions
having the argument as const or stored as a reference in the "ci_type"
const field of a config_item structure.

Done using Coccienlle.

Signed-off-by: Bhumika Goyal 
---
* Changes in v2- Combine all the followup patches and the constification
patches into a series.

 drivers/acpi/acpi_configfs.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/acpi/acpi_configfs.c b/drivers/acpi/acpi_configfs.c
index 853bc7f..b588503 100644
--- a/drivers/acpi/acpi_configfs.c
+++ b/drivers/acpi/acpi_configfs.c
@@ -204,7 +204,7 @@ struct configfs_attribute *acpi_table_attrs[] = {
NULL,
 };
 
-static struct config_item_type acpi_table_type = {
+static const struct config_item_type acpi_table_type = {
.ct_owner = THIS_MODULE,
.ct_bin_attrs = acpi_table_bin_attrs,
.ct_attrs = acpi_table_attrs,
@@ -237,12 +237,12 @@ struct configfs_group_operations acpi_table_group_ops = {
.drop_item = acpi_table_drop_item,
 };
 
-static struct config_item_type acpi_tables_type = {
+static const struct config_item_type acpi_tables_type = {
.ct_owner = THIS_MODULE,
.ct_group_ops = &acpi_table_group_ops,
 };
 
-static struct config_item_type acpi_root_group_type = {
+static const struct config_item_type acpi_root_group_type = {
.ct_owner = THIS_MODULE,
 };
 
-- 
1.9.1



[PATCH v2 08/15] nvmet: make config_item_type const

2017-10-16 Thread Bhumika Goyal
Make config_item_type structures const as they are either passed to a
function having the argument as const or used inside an if statement or
stored in the const "ci_type" field of a config_item structure.

Done using Coccinelle

Signed-off-by: Bhumika Goyal 
---
* Changes in v2- Combine all the followup patches and the constification
patches into a series.

 drivers/nvme/target/configfs.c | 30 +++---
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/drivers/nvme/target/configfs.c b/drivers/nvme/target/configfs.c
index b6aeb1d..e6b2d2a 100644
--- a/drivers/nvme/target/configfs.c
+++ b/drivers/nvme/target/configfs.c
@@ -20,8 +20,8 @@
 
 #include "nvmet.h"
 
-static struct config_item_type nvmet_host_type;
-static struct config_item_type nvmet_subsys_type;
+static const struct config_item_type nvmet_host_type;
+static const struct config_item_type nvmet_subsys_type;
 
 /*
  * nvmet_port Generic ConfigFS definitions.
@@ -425,7 +425,7 @@ static void nvmet_ns_release(struct config_item *item)
.release= nvmet_ns_release,
 };
 
-static struct config_item_type nvmet_ns_type = {
+static const struct config_item_type nvmet_ns_type = {
.ct_item_ops= &nvmet_ns_item_ops,
.ct_attrs   = nvmet_ns_attrs,
.ct_owner   = THIS_MODULE,
@@ -464,7 +464,7 @@ static struct config_group *nvmet_ns_make(struct 
config_group *group,
.make_group = nvmet_ns_make,
 };
 
-static struct config_item_type nvmet_namespaces_type = {
+static const struct config_item_type nvmet_namespaces_type = {
.ct_group_ops   = &nvmet_namespaces_group_ops,
.ct_owner   = THIS_MODULE,
 };
@@ -540,7 +540,7 @@ static void nvmet_port_subsys_drop_link(struct config_item 
*parent,
.drop_link  = nvmet_port_subsys_drop_link,
 };
 
-static struct config_item_type nvmet_port_subsys_type = {
+static const struct config_item_type nvmet_port_subsys_type = {
.ct_item_ops= &nvmet_port_subsys_item_ops,
.ct_owner   = THIS_MODULE,
 };
@@ -613,7 +613,7 @@ static void nvmet_allowed_hosts_drop_link(struct 
config_item *parent,
.drop_link  = nvmet_allowed_hosts_drop_link,
 };
 
-static struct config_item_type nvmet_allowed_hosts_type = {
+static const struct config_item_type nvmet_allowed_hosts_type = {
.ct_item_ops= &nvmet_allowed_hosts_item_ops,
.ct_owner   = THIS_MODULE,
 };
@@ -729,7 +729,7 @@ static void nvmet_subsys_release(struct config_item *item)
.release= nvmet_subsys_release,
 };
 
-static struct config_item_type nvmet_subsys_type = {
+static const struct config_item_type nvmet_subsys_type = {
.ct_item_ops= &nvmet_subsys_item_ops,
.ct_attrs   = nvmet_subsys_attrs,
.ct_owner   = THIS_MODULE,
@@ -767,7 +767,7 @@ static struct config_group *nvmet_subsys_make(struct 
config_group *group,
.make_group = nvmet_subsys_make,
 };
 
-static struct config_item_type nvmet_subsystems_type = {
+static const struct config_item_type nvmet_subsystems_type = {
.ct_group_ops   = &nvmet_subsystems_group_ops,
.ct_owner   = THIS_MODULE,
 };
@@ -827,7 +827,7 @@ static void nvmet_referral_release(struct config_item *item)
.release= nvmet_referral_release,
 };
 
-static struct config_item_type nvmet_referral_type = {
+static const struct config_item_type nvmet_referral_type = {
.ct_owner   = THIS_MODULE,
.ct_attrs   = nvmet_referral_attrs,
.ct_item_ops= &nvmet_referral_item_ops,
@@ -852,7 +852,7 @@ static struct config_group *nvmet_referral_make(
.make_group = nvmet_referral_make,
 };
 
-static struct config_item_type nvmet_referrals_type = {
+static const struct config_item_type nvmet_referrals_type = {
.ct_owner   = THIS_MODULE,
.ct_group_ops   = &nvmet_referral_group_ops,
 };
@@ -880,7 +880,7 @@ static void nvmet_port_release(struct config_item *item)
.release= nvmet_port_release,
 };
 
-static struct config_item_type nvmet_port_type = {
+static const struct config_item_type nvmet_port_type = {
.ct_attrs   = nvmet_port_attrs,
.ct_item_ops= &nvmet_port_item_ops,
.ct_owner   = THIS_MODULE,
@@ -921,7 +921,7 @@ static struct config_group *nvmet_ports_make(struct 
config_group *group,
.make_group = nvmet_ports_make,
 };
 
-static struct config_item_type nvmet_ports_type = {
+static const struct config_item_type nvmet_ports_type = {
.ct_group_ops   = &nvmet_ports_group_ops,
.ct_owner   = THIS_MODULE,
 };
@@ -940,7 +940,7 @@ static void nvmet_host_release(struct config_item

[PATCH v2 06/15] PCI: endpoint: make config_item_type const

2017-10-16 Thread Bhumika Goyal
Make config_item_type structures const as they are either passed to a
function having the argument as const or stored in the const "ci_type"
field of a config_item structure.

Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
* Changes in v2- Combine all the followup patches and the constification
patches into a series.

 drivers/pci/endpoint/pci-ep-cfs.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/pci/endpoint/pci-ep-cfs.c 
b/drivers/pci/endpoint/pci-ep-cfs.c
index 424fdd6..4f74386 100644
--- a/drivers/pci/endpoint/pci-ep-cfs.c
+++ b/drivers/pci/endpoint/pci-ep-cfs.c
@@ -150,7 +150,7 @@ static void pci_epc_epf_unlink(struct config_item *epc_item,
.drop_link  = pci_epc_epf_unlink,
 };
 
-static struct config_item_type pci_epc_type = {
+static const struct config_item_type pci_epc_type = {
.ct_item_ops= &pci_epc_item_ops,
.ct_attrs   = pci_epc_attrs,
.ct_owner   = THIS_MODULE,
@@ -361,7 +361,7 @@ static void pci_epf_release(struct config_item *item)
.release= pci_epf_release,
 };
 
-static struct config_item_type pci_epf_type = {
+static const struct config_item_type pci_epf_type = {
.ct_item_ops= &pci_epf_ops,
.ct_attrs   = pci_epf_attrs,
.ct_owner   = THIS_MODULE,
@@ -400,7 +400,7 @@ static void pci_epf_drop(struct config_group *group, struct 
config_item *item)
.drop_item  = &pci_epf_drop,
 };
 
-static struct config_item_type pci_epf_group_type = {
+static const struct config_item_type pci_epf_group_type = {
.ct_group_ops   = &pci_epf_group_ops,
.ct_owner   = THIS_MODULE,
 };
@@ -428,15 +428,15 @@ void pci_ep_cfs_remove_epf_group(struct config_group 
*group)
 }
 EXPORT_SYMBOL(pci_ep_cfs_remove_epf_group);
 
-static struct config_item_type pci_functions_type = {
+static const struct config_item_type pci_functions_type = {
.ct_owner   = THIS_MODULE,
 };
 
-static struct config_item_type pci_controllers_type = {
+static const struct config_item_type pci_controllers_type = {
.ct_owner   = THIS_MODULE,
 };
 
-static struct config_item_type pci_ep_type = {
+static const struct config_item_type pci_ep_type = {
.ct_owner   = THIS_MODULE,
 };
 
-- 
1.9.1



[PATCH v2 07/15] usb: gadget: configfs: make config_item_type const

2017-10-16 Thread Bhumika Goyal
Make config_item_type structures const as they are either passed to a
function having the argument as const or stored in the const "ci_type"
field of a config_item structure.

Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
* Changes in v2- Combine all the followup patches and the constification
patches into a series.

 drivers/usb/gadget/configfs.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/gadget/configfs.c b/drivers/usb/gadget/configfs.c
index aeb9f3c..9d18b99 100644
--- a/drivers/usb/gadget/configfs.c
+++ b/drivers/usb/gadget/configfs.c
@@ -505,13 +505,13 @@ static ssize_t 
gadget_config_desc_bmAttributes_store(struct config_item *item,
NULL,
 };
 
-static struct config_item_type gadget_config_type = {
+static const struct config_item_type gadget_config_type = {
.ct_item_ops= &gadget_config_item_ops,
.ct_attrs   = gadget_config_attrs,
.ct_owner   = THIS_MODULE,
 };
 
-static struct config_item_type gadget_root_type = {
+static const struct config_item_type gadget_root_type = {
.ct_item_ops= &gadget_root_item_ops,
.ct_attrs   = gadget_root_attrs,
.ct_owner   = THIS_MODULE,
@@ -593,7 +593,7 @@ static void function_drop(
.drop_item  = &function_drop,
 };
 
-static struct config_item_type functions_type = {
+static const struct config_item_type functions_type = {
.ct_group_ops   = &functions_ops,
.ct_owner   = THIS_MODULE,
 };
@@ -694,7 +694,7 @@ static void config_desc_drop(
.drop_item  = &config_desc_drop,
 };
 
-static struct config_item_type config_desc_type = {
+static const struct config_item_type config_desc_type = {
.ct_group_ops   = &config_desc_ops,
.ct_owner   = THIS_MODULE,
 };
@@ -1476,7 +1476,7 @@ static void gadgets_drop(struct config_group *group, 
struct config_item *item)
.drop_item  = &gadgets_drop,
 };
 
-static struct config_item_type gadgets_type = {
+static const struct config_item_type gadgets_type = {
.ct_group_ops   = &gadgets_ops,
.ct_owner   = THIS_MODULE,
 };
-- 
1.9.1



[PATCH v2 05/15] ocfs2/cluster: make config_item_type const

2017-10-16 Thread Bhumika Goyal
Make these structures const as they are either passed to the functions
having the argument as const or stored as a reference in the "ci_type"
const field of a config_item structure.

Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
* Changes in v2- Combine all the followup patches and the constification
patches into a series.

 fs/ocfs2/cluster/heartbeat.c   | 4 ++--
 fs/ocfs2/cluster/nodemanager.c | 8 
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c
index d020604..ea8c551 100644
--- a/fs/ocfs2/cluster/heartbeat.c
+++ b/fs/ocfs2/cluster/heartbeat.c
@@ -2025,7 +2025,7 @@ static ssize_t o2hb_region_pid_show(struct config_item 
*item, char *page)
.release= o2hb_region_release,
 };
 
-static struct config_item_type o2hb_region_type = {
+static const struct config_item_type o2hb_region_type = {
.ct_item_ops= &o2hb_region_item_ops,
.ct_attrs   = o2hb_region_attrs,
.ct_owner   = THIS_MODULE,
@@ -2310,7 +2310,7 @@ static ssize_t o2hb_heartbeat_group_mode_store(struct 
config_item *item,
.drop_item  = o2hb_heartbeat_group_drop_item,
 };
 
-static struct config_item_type o2hb_heartbeat_group_type = {
+static const struct config_item_type o2hb_heartbeat_group_type = {
.ct_group_ops   = &o2hb_heartbeat_group_group_ops,
.ct_attrs   = o2hb_heartbeat_group_attrs,
.ct_owner   = THIS_MODULE,
diff --git a/fs/ocfs2/cluster/nodemanager.c b/fs/ocfs2/cluster/nodemanager.c
index b17d180..a51200e 100644
--- a/fs/ocfs2/cluster/nodemanager.c
+++ b/fs/ocfs2/cluster/nodemanager.c
@@ -378,7 +378,7 @@ static ssize_t o2nm_node_local_store(struct config_item 
*item, const char *page,
.release= o2nm_node_release,
 };
 
-static struct config_item_type o2nm_node_type = {
+static const struct config_item_type o2nm_node_type = {
.ct_item_ops= &o2nm_node_item_ops,
.ct_attrs   = o2nm_node_attrs,
.ct_owner   = THIS_MODULE,
@@ -619,7 +619,7 @@ static void o2nm_node_group_drop_item(struct config_group 
*group,
.drop_item  = o2nm_node_group_drop_item,
 };
 
-static struct config_item_type o2nm_node_group_type = {
+static const struct config_item_type o2nm_node_group_type = {
.ct_group_ops   = &o2nm_node_group_group_ops,
.ct_owner   = THIS_MODULE,
 };
@@ -637,7 +637,7 @@ static void o2nm_cluster_release(struct config_item *item)
.release= o2nm_cluster_release,
 };
 
-static struct config_item_type o2nm_cluster_type = {
+static const struct config_item_type o2nm_cluster_type = {
.ct_item_ops= &o2nm_cluster_item_ops,
.ct_attrs   = o2nm_cluster_attrs,
.ct_owner   = THIS_MODULE,
@@ -722,7 +722,7 @@ static void o2nm_cluster_group_drop_item(struct 
config_group *group, struct conf
.drop_item  = o2nm_cluster_group_drop_item,
 };
 
-static struct config_item_type o2nm_cluster_group_type = {
+static const struct config_item_type o2nm_cluster_group_type = {
.ct_group_ops   = &o2nm_cluster_group_group_ops,
.ct_owner   = THIS_MODULE,
 };
-- 
1.9.1



[PATCH v2 03/15] target: make config_item_type const

2017-10-16 Thread Bhumika Goyal
Make these structures const as they are either passed to the functions
having the argument as const or stored as a reference in the "ci_type"
const field of a config_item structure.

Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
* Changes in v2- Combine all the followup patches and the constification
patches into a series.

 drivers/target/iscsi/iscsi_target_stat.c | 12 ++--
 drivers/target/target_core_configfs.c| 14 +++---
 drivers/target/target_core_stat.c| 16 
 include/target/iscsi/iscsi_target_stat.h | 12 ++--
 4 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/drivers/target/iscsi/iscsi_target_stat.c 
b/drivers/target/iscsi/iscsi_target_stat.c
index 411cb26..df0a398 100644
--- a/drivers/target/iscsi/iscsi_target_stat.c
+++ b/drivers/target/iscsi/iscsi_target_stat.c
@@ -187,7 +187,7 @@ static ssize_t iscsi_stat_instance_version_show(struct 
config_item *item,
NULL,
 };
 
-struct config_item_type iscsi_stat_instance_cit = {
+const struct config_item_type iscsi_stat_instance_cit = {
.ct_attrs   = iscsi_stat_instance_attrs,
.ct_owner   = THIS_MODULE,
 };
@@ -249,7 +249,7 @@ static ssize_t 
iscsi_stat_sess_err_format_errors_show(struct config_item *item,
NULL,
 };
 
-struct config_item_type iscsi_stat_sess_err_cit = {
+const struct config_item_type iscsi_stat_sess_err_cit = {
.ct_attrs   = iscsi_stat_sess_err_attrs,
.ct_owner   = THIS_MODULE,
 };
@@ -390,7 +390,7 @@ static ssize_t 
iscsi_stat_tgt_attr_fail_intr_addr_show(struct config_item *item,
NULL,
 };
 
-struct config_item_type iscsi_stat_tgt_attr_cit = {
+const struct config_item_type iscsi_stat_tgt_attr_cit = {
.ct_attrs   = iscsi_stat_tgt_attr_attrs,
.ct_owner   = THIS_MODULE,
 };
@@ -522,7 +522,7 @@ static ssize_t iscsi_stat_login_negotiate_fails_show(struct 
config_item *item,
NULL,
 };
 
-struct config_item_type iscsi_stat_login_cit = {
+const struct config_item_type iscsi_stat_login_cit = {
.ct_attrs   = iscsi_stat_login_stats_attrs,
.ct_owner   = THIS_MODULE,
 };
@@ -579,7 +579,7 @@ static ssize_t 
iscsi_stat_logout_abnormal_logouts_show(struct config_item *item,
NULL,
 };
 
-struct config_item_type iscsi_stat_logout_cit = {
+const struct config_item_type iscsi_stat_logout_cit = {
.ct_attrs   = iscsi_stat_logout_stats_attrs,
.ct_owner   = THIS_MODULE,
 };
@@ -801,7 +801,7 @@ static ssize_t iscsi_stat_sess_conn_timeout_errors_show(
NULL,
 };
 
-struct config_item_type iscsi_stat_sess_cit = {
+const struct config_item_type iscsi_stat_sess_cit = {
.ct_attrs   = iscsi_stat_sess_stats_attrs,
.ct_owner   = THIS_MODULE,
 };
diff --git a/drivers/target/target_core_configfs.c 
b/drivers/target/target_core_configfs.c
index 7e87d95..bd87cc2 100644
--- a/drivers/target/target_core_configfs.c
+++ b/drivers/target/target_core_configfs.c
@@ -307,7 +307,7 @@ static void target_core_deregister_fabric(
 /*
  * Provides Fabrics Groups and Item Attributes for /sys/kernel/config/target/
  */
-static struct config_item_type target_core_fabrics_item = {
+static const struct config_item_type target_core_fabrics_item = {
.ct_group_ops   = &target_core_fabric_group_ops,
.ct_attrs   = target_core_fabric_item_attrs,
.ct_owner   = THIS_MODULE,
@@ -2376,7 +2376,7 @@ static void target_core_alua_lu_gp_release(struct 
config_item *item)
.release= target_core_alua_lu_gp_release,
 };
 
-static struct config_item_type target_core_alua_lu_gp_cit = {
+static const struct config_item_type target_core_alua_lu_gp_cit = {
.ct_item_ops= &target_core_alua_lu_gp_ops,
.ct_attrs   = target_core_alua_lu_gp_attrs,
.ct_owner   = THIS_MODULE,
@@ -2434,7 +2434,7 @@ static void target_core_alua_drop_lu_gp(
.drop_item  = &target_core_alua_drop_lu_gp,
 };
 
-static struct config_item_type target_core_alua_lu_gps_cit = {
+static const struct config_item_type target_core_alua_lu_gps_cit = {
.ct_item_ops= NULL,
.ct_group_ops   = &target_core_alua_lu_gps_group_ops,
.ct_owner   = THIS_MODULE,
@@ -2813,7 +2813,7 @@ static void target_core_alua_tg_pt_gp_release(struct 
config_item *item)
.release= target_core_alua_tg_pt_gp_release,
 };
 
-static struct config_item_type target_core_alua_tg_pt_gp_cit = {
+static const struct config_item_type target_core_alua_tg_pt_gp_cit = {
.ct_item_ops= &target_core_alua_tg_pt_gp_ops,
.ct_attrs   = target_core_alua_tg_pt_gp_attrs,
.ct_owner   = THIS_MODULE,
@@ -2884,7 +2884,7 @@ static void target_core_alu

[PATCH v2 04/15] iio: make function argument and some structures const

2017-10-16 Thread Bhumika Goyal
Make the argument of the functions iio_sw{d/t}_group_init_type_name const
as they are only passed to the function config_group_init_type_name having
the argument as const.

Make the config_item_type structures const as they are either passed to
the functions having the argument as const or they are
stored in the const "ci_type" field of a config_item structure.

Signed-off-by: Bhumika Goyal 
---
* Changes in v2- Combine all the followup patches and the constification
patches into a series.

 drivers/iio/dummy/iio_simple_dummy.c   | 2 +-
 drivers/iio/industrialio-configfs.c| 2 +-
 drivers/iio/industrialio-sw-device.c   | 6 +++---
 drivers/iio/industrialio-sw-trigger.c  | 6 +++---
 drivers/iio/trigger/iio-trig-hrtimer.c | 2 +-
 drivers/iio/trigger/iio-trig-loop.c| 2 +-
 include/linux/iio/sw_device.h  | 2 +-
 include/linux/iio/sw_trigger.h | 2 +-
 8 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/iio/dummy/iio_simple_dummy.c 
b/drivers/iio/dummy/iio_simple_dummy.c
index a45d01e..6205247 100644
--- a/drivers/iio/dummy/iio_simple_dummy.c
+++ b/drivers/iio/dummy/iio_simple_dummy.c
@@ -26,7 +26,7 @@
 #include 
 #include "iio_simple_dummy.h"
 
-static struct config_item_type iio_dummy_type = {
+static const struct config_item_type iio_dummy_type = {
.ct_owner = THIS_MODULE,
 };
 
diff --git a/drivers/iio/industrialio-configfs.c 
b/drivers/iio/industrialio-configfs.c
index 45ce2bc..5a0aae1 100644
--- a/drivers/iio/industrialio-configfs.c
+++ b/drivers/iio/industrialio-configfs.c
@@ -17,7 +17,7 @@
 #include 
 #include 
 
-static struct config_item_type iio_root_group_type = {
+static const struct config_item_type iio_root_group_type = {
.ct_owner   = THIS_MODULE,
 };
 
diff --git a/drivers/iio/industrialio-sw-device.c 
b/drivers/iio/industrialio-sw-device.c
index 81b49cf..90df97c 100644
--- a/drivers/iio/industrialio-sw-device.c
+++ b/drivers/iio/industrialio-sw-device.c
@@ -19,9 +19,9 @@
 #include 
 
 static struct config_group *iio_devices_group;
-static struct config_item_type iio_device_type_group_type;
+static const struct config_item_type iio_device_type_group_type;
 
-static struct config_item_type iio_devices_group_type = {
+static const struct config_item_type iio_devices_group_type = {
.ct_owner = THIS_MODULE,
 };
 
@@ -156,7 +156,7 @@ static void device_drop_group(struct config_group *group,
.drop_item  = &device_drop_group,
 };
 
-static struct config_item_type iio_device_type_group_type = {
+static const struct config_item_type iio_device_type_group_type = {
.ct_group_ops = &device_ops,
.ct_owner   = THIS_MODULE,
 };
diff --git a/drivers/iio/industrialio-sw-trigger.c 
b/drivers/iio/industrialio-sw-trigger.c
index 8d24fb1..bc6b7fb 100644
--- a/drivers/iio/industrialio-sw-trigger.c
+++ b/drivers/iio/industrialio-sw-trigger.c
@@ -19,9 +19,9 @@
 #include 
 
 static struct config_group *iio_triggers_group;
-static struct config_item_type iio_trigger_type_group_type;
+static const struct config_item_type iio_trigger_type_group_type;
 
-static struct config_item_type iio_triggers_group_type = {
+static const struct config_item_type iio_triggers_group_type = {
.ct_owner = THIS_MODULE,
 };
 
@@ -156,7 +156,7 @@ static void trigger_drop_group(struct config_group *group,
.drop_item  = &trigger_drop_group,
 };
 
-static struct config_item_type iio_trigger_type_group_type = {
+static const struct config_item_type iio_trigger_type_group_type = {
.ct_group_ops = &trigger_ops,
.ct_owner   = THIS_MODULE,
 };
diff --git a/drivers/iio/trigger/iio-trig-hrtimer.c 
b/drivers/iio/trigger/iio-trig-hrtimer.c
index 3ee9216..7accd01 100644
--- a/drivers/iio/trigger/iio-trig-hrtimer.c
+++ b/drivers/iio/trigger/iio-trig-hrtimer.c
@@ -30,7 +30,7 @@ struct iio_hrtimer_info {
ktime_t period;
 };
 
-static struct config_item_type iio_hrtimer_type = {
+static const struct config_item_type iio_hrtimer_type = {
.ct_owner = THIS_MODULE,
 };
 
diff --git a/drivers/iio/trigger/iio-trig-loop.c 
b/drivers/iio/trigger/iio-trig-loop.c
index b4b02db..94a90e0 100644
--- a/drivers/iio/trigger/iio-trig-loop.c
+++ b/drivers/iio/trigger/iio-trig-loop.c
@@ -36,7 +36,7 @@ struct iio_loop_info {
struct task_struct *task;
 };
 
-static struct config_item_type iio_loop_type = {
+static const struct config_item_type iio_loop_type = {
.ct_owner = THIS_MODULE,
 };
 
diff --git a/include/linux/iio/sw_device.h b/include/linux/iio/sw_device.h
index fa79319..8642b91 100644
--- a/include/linux/iio/sw_device.h
+++ b/include/linux/iio/sw_device.h
@@ -60,7 +60,7 @@ struct iio_sw_device *to_iio_sw_device(struct config_item 
*item)
 static inline
 void iio_swd_group_init_type_name(struct iio_sw_device *d,
  const char *name,
- struct config_item_type *type)
+

[PATCH v2 02/15] usb: gadget: make config_item_type structures const

2017-10-16 Thread Bhumika Goyal
Make these structures const as they are only passed to the const
argument of the functions config_{group/item}_init_type_name.

Signed-off-by: Bhumika Goyal 
---
* Changes in v2- Combine all the followup patches and the constification
patches into a series.

 drivers/usb/gadget/function/f_acm.c  |  2 +-
 drivers/usb/gadget/function/f_ecm.c  |  2 +-
 drivers/usb/gadget/function/f_eem.c  |  2 +-
 drivers/usb/gadget/function/f_fs.c   |  2 +-
 drivers/usb/gadget/function/f_hid.c  |  2 +-
 drivers/usb/gadget/function/f_loopback.c |  2 +-
 drivers/usb/gadget/function/f_mass_storage.c |  4 +--
 drivers/usb/gadget/function/f_midi.c |  2 +-
 drivers/usb/gadget/function/f_ncm.c  |  2 +-
 drivers/usb/gadget/function/f_obex.c |  2 +-
 drivers/usb/gadget/function/f_phonet.c   |  2 +-
 drivers/usb/gadget/function/f_printer.c  |  2 +-
 drivers/usb/gadget/function/f_rndis.c|  2 +-
 drivers/usb/gadget/function/f_serial.c   |  2 +-
 drivers/usb/gadget/function/f_sourcesink.c   |  2 +-
 drivers/usb/gadget/function/f_subset.c   |  2 +-
 drivers/usb/gadget/function/f_tcm.c  |  2 +-
 drivers/usb/gadget/function/f_uac1.c |  2 +-
 drivers/usb/gadget/function/f_uac1_legacy.c  |  2 +-
 drivers/usb/gadget/function/f_uac2.c |  2 +-
 drivers/usb/gadget/function/uvc_configfs.c   | 50 ++--
 21 files changed, 46 insertions(+), 46 deletions(-)

diff --git a/drivers/usb/gadget/function/f_acm.c 
b/drivers/usb/gadget/function/f_acm.c
index 5e3828d..8680af4 100644
--- a/drivers/usb/gadget/function/f_acm.c
+++ b/drivers/usb/gadget/function/f_acm.c
@@ -786,7 +786,7 @@ static ssize_t f_acm_port_num_show(struct config_item 
*item, char *page)
NULL,
 };
 
-static struct config_item_type acm_func_type = {
+static const struct config_item_type acm_func_type = {
.ct_item_ops= &acm_item_ops,
.ct_attrs   = acm_attrs,
.ct_owner   = THIS_MODULE,
diff --git a/drivers/usb/gadget/function/f_ecm.c 
b/drivers/usb/gadget/function/f_ecm.c
index 4c488d1..9657e19 100644
--- a/drivers/usb/gadget/function/f_ecm.c
+++ b/drivers/usb/gadget/function/f_ecm.c
@@ -845,7 +845,7 @@ static inline struct f_ecm_opts *to_f_ecm_opts(struct 
config_item *item)
NULL,
 };
 
-static struct config_item_type ecm_func_type = {
+static const struct config_item_type ecm_func_type = {
.ct_item_ops= &ecm_item_ops,
.ct_attrs   = ecm_attrs,
.ct_owner   = THIS_MODULE,
diff --git a/drivers/usb/gadget/function/f_eem.c 
b/drivers/usb/gadget/function/f_eem.c
index 007ec6e..5e5d164 100644
--- a/drivers/usb/gadget/function/f_eem.c
+++ b/drivers/usb/gadget/function/f_eem.c
@@ -556,7 +556,7 @@ static inline struct f_eem_opts *to_f_eem_opts(struct 
config_item *item)
NULL,
 };
 
-static struct config_item_type eem_func_type = {
+static const struct config_item_type eem_func_type = {
.ct_item_ops= &eem_item_ops,
.ct_attrs   = eem_attrs,
.ct_owner   = THIS_MODULE,
diff --git a/drivers/usb/gadget/function/f_fs.c 
b/drivers/usb/gadget/function/f_fs.c
index 8b34258..5362fc4 100644
--- a/drivers/usb/gadget/function/f_fs.c
+++ b/drivers/usb/gadget/function/f_fs.c
@@ -3385,7 +3385,7 @@ static void ffs_attr_release(struct config_item *item)
.release= ffs_attr_release,
 };
 
-static struct config_item_type ffs_func_type = {
+static const struct config_item_type ffs_func_type = {
.ct_item_ops= &ffs_item_ops,
.ct_owner   = THIS_MODULE,
 };
diff --git a/drivers/usb/gadget/function/f_hid.c 
b/drivers/usb/gadget/function/f_hid.c
index d8e359e..6993cb8 100644
--- a/drivers/usb/gadget/function/f_hid.c
+++ b/drivers/usb/gadget/function/f_hid.c
@@ -992,7 +992,7 @@ static ssize_t f_hid_opts_dev_show(struct config_item 
*item, char *page)
NULL,
 };
 
-static struct config_item_type hid_func_type = {
+static const struct config_item_type hid_func_type = {
.ct_item_ops= &hidg_item_ops,
.ct_attrs   = hid_attrs,
.ct_owner   = THIS_MODULE,
diff --git a/drivers/usb/gadget/function/f_loopback.c 
b/drivers/usb/gadget/function/f_loopback.c
index e700938..9311f8c 100644
--- a/drivers/usb/gadget/function/f_loopback.c
+++ b/drivers/usb/gadget/function/f_loopback.c
@@ -556,7 +556,7 @@ static ssize_t f_lb_opts_bulk_buflen_store(struct 
config_item *item,
NULL,
 };
 
-static struct config_item_type lb_func_type = {
+static const struct config_item_type lb_func_type = {
.ct_item_ops= &lb_item_ops,
.ct_attrs   = lb_attrs,
.ct_owner   = THIS_MODULE,
diff --git a/drivers/usb/gadget/function/f_mass_storage.c 
b/drivers/usb/gadget/function/f_mass_storage.c
index 5153e29..a538be3 100644
--- a/drivers/usb/gadget/function/f_mass_storage.c
+++ b/drivers/usb/gadget/function/f_mass_storage.c
@@ -3140,7 +

[PATCH v2 00/15] make structure field, function arguments and structures const

2017-10-16 Thread Bhumika Goyal
Make the ci_type field and some function arguments as const. After this
change, make config_item_type structures as const.

* Changes in v2- Combine all the followup patches and the constification
patches into a series.

Bhumika Goyal (15):
  configfs: make ci_type field, some pointers and function arguments
const
  usb: gadget: make config_item_type structures const
  target: make config_item_type const
  iio: make function argument and some structures const
  ocfs2/cluster: make config_item_type const
  PCI: endpoint: make config_item_type const
  usb: gadget: configfs: make config_item_type const
  nvmet: make config_item_type const
  ACPI: configfs: make config_item_type const
  nullb: make config_item_type const
  stm class: make config_item_type const
  RDMA/cma: make config_item_type const
  netconsole: make config_item_type const
  dlm: make config_item_type const
  configfs: make config_item_type const

 drivers/acpi/acpi_configfs.c |  6 ++--
 drivers/block/null_blk.c |  4 +--
 drivers/hwtracing/stm/policy.c   | 10 +++---
 drivers/iio/dummy/iio_simple_dummy.c |  2 +-
 drivers/iio/industrialio-configfs.c  |  2 +-
 drivers/iio/industrialio-sw-device.c |  6 ++--
 drivers/iio/industrialio-sw-trigger.c|  6 ++--
 drivers/iio/trigger/iio-trig-hrtimer.c   |  2 +-
 drivers/iio/trigger/iio-trig-loop.c  |  2 +-
 drivers/infiniband/core/cma_configfs.c   |  8 ++---
 drivers/net/netconsole.c |  4 +--
 drivers/nvme/target/configfs.c   | 30 -
 drivers/pci/endpoint/pci-ep-cfs.c| 12 +++
 drivers/target/iscsi/iscsi_target_stat.c | 12 +++
 drivers/target/target_core_configfs.c| 14 
 drivers/target/target_core_stat.c| 16 -
 drivers/usb/gadget/configfs.c| 10 +++---
 drivers/usb/gadget/function/f_acm.c  |  2 +-
 drivers/usb/gadget/function/f_ecm.c  |  2 +-
 drivers/usb/gadget/function/f_eem.c  |  2 +-
 drivers/usb/gadget/function/f_fs.c   |  2 +-
 drivers/usb/gadget/function/f_hid.c  |  2 +-
 drivers/usb/gadget/function/f_loopback.c |  2 +-
 drivers/usb/gadget/function/f_mass_storage.c |  4 +--
 drivers/usb/gadget/function/f_midi.c |  2 +-
 drivers/usb/gadget/function/f_ncm.c  |  2 +-
 drivers/usb/gadget/function/f_obex.c |  2 +-
 drivers/usb/gadget/function/f_phonet.c   |  2 +-
 drivers/usb/gadget/function/f_printer.c  |  2 +-
 drivers/usb/gadget/function/f_rndis.c|  2 +-
 drivers/usb/gadget/function/f_serial.c   |  2 +-
 drivers/usb/gadget/function/f_sourcesink.c   |  2 +-
 drivers/usb/gadget/function/f_subset.c   |  2 +-
 drivers/usb/gadget/function/f_tcm.c  |  2 +-
 drivers/usb/gadget/function/f_uac1.c |  2 +-
 drivers/usb/gadget/function/f_uac1_legacy.c  |  2 +-
 drivers/usb/gadget/function/f_uac2.c |  2 +-
 drivers/usb/gadget/function/uvc_configfs.c   | 50 ++--
 fs/configfs/dir.c| 10 +++---
 fs/configfs/item.c   |  6 ++--
 fs/configfs/symlink.c|  4 +--
 fs/dlm/config.c  | 16 -
 fs/ocfs2/cluster/heartbeat.c |  4 +--
 fs/ocfs2/cluster/nodemanager.c   |  8 ++---
 include/linux/configfs.h |  8 ++---
 include/linux/iio/sw_device.h|  2 +-
 include/linux/iio/sw_trigger.h   |  2 +-
 include/target/iscsi/iscsi_target_stat.h | 12 +++
 samples/configfs/configfs_sample.c   |  8 ++---
 49 files changed, 159 insertions(+), 159 deletions(-)

-- 
1.9.1



[PATCH v2 01/15] configfs: make ci_type field, some pointers and function arguments const

2017-10-16 Thread Bhumika Goyal
The ci_type field of the config_item structure do not modify the fields
of the config_item_type structure it points to. And the other pointers
initialized with ci_type do not modify the fields as well.
So, make the ci_type field and the pointers initialized with ci_type
as const.

Make the struct config_item_type *type function argument of functions
config_{item/group}_init_type_name const as the argument in both the
functions is only stored in the ci_type field of a config_item structure
which is now made const.
Make the argument of configfs_register_default_group const as it is
only passed to the argument of the function config_group_init_type_name
which is now const.

Signed-off-by: Bhumika Goyal 
---
* Changes in v2- Combine all the followup patches and the constification
patches into a series.

 fs/configfs/dir.c| 10 +-
 fs/configfs/item.c   |  6 +++---
 fs/configfs/symlink.c|  4 ++--
 include/linux/configfs.h |  8 
 4 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/fs/configfs/dir.c b/fs/configfs/dir.c
index 56fb261..577cff2 100644
--- a/fs/configfs/dir.c
+++ b/fs/configfs/dir.c
@@ -584,7 +584,7 @@ static void detach_attrs(struct config_item * item)
 
 static int populate_attrs(struct config_item *item)
 {
-   struct config_item_type *t = item->ci_type;
+   const struct config_item_type *t = item->ci_type;
struct configfs_attribute *attr;
struct configfs_bin_attribute *bin_attr;
int error = 0;
@@ -901,7 +901,7 @@ static void configfs_detach_group(struct config_item *item)
 static void client_disconnect_notify(struct config_item *parent_item,
 struct config_item *item)
 {
-   struct config_item_type *type;
+   const struct config_item_type *type;
 
type = parent_item->ci_type;
BUG_ON(!type);
@@ -920,7 +920,7 @@ static void client_disconnect_notify(struct config_item 
*parent_item,
 static void client_drop_item(struct config_item *parent_item,
 struct config_item *item)
 {
-   struct config_item_type *type;
+   const struct config_item_type *type;
 
type = parent_item->ci_type;
BUG_ON(!type);
@@ -1260,7 +1260,7 @@ static int configfs_mkdir(struct inode *dir, struct 
dentry *dentry, umode_t mode
struct config_item *parent_item;
struct configfs_subsystem *subsys;
struct configfs_dirent *sd;
-   struct config_item_type *type;
+   const struct config_item_type *type;
struct module *subsys_owner = NULL, *new_item_owner = NULL;
char *name;
 
@@ -1810,7 +1810,7 @@ void configfs_unregister_group(struct config_group *group)
 struct config_group *
 configfs_register_default_group(struct config_group *parent_group,
const char *name,
-   struct config_item_type *item_type)
+   const struct config_item_type *item_type)
 {
int ret;
struct config_group *group;
diff --git a/fs/configfs/item.c b/fs/configfs/item.c
index a66f662..88f266e 100644
--- a/fs/configfs/item.c
+++ b/fs/configfs/item.c
@@ -113,7 +113,7 @@ int config_item_set_name(struct config_item *item, const 
char *fmt, ...)
 
 void config_item_init_type_name(struct config_item *item,
const char *name,
-   struct config_item_type *type)
+   const struct config_item_type *type)
 {
config_item_set_name(item, "%s", name);
item->ci_type = type;
@@ -122,7 +122,7 @@ void config_item_init_type_name(struct config_item *item,
 EXPORT_SYMBOL(config_item_init_type_name);
 
 void config_group_init_type_name(struct config_group *group, const char *name,
-struct config_item_type *type)
+const struct config_item_type *type)
 {
config_item_set_name(&group->cg_item, "%s", name);
group->cg_item.ci_type = type;
@@ -148,7 +148,7 @@ struct config_item *config_item_get_unless_zero(struct 
config_item *item)
 
 static void config_item_cleanup(struct config_item *item)
 {
-   struct config_item_type *t = item->ci_type;
+   const struct config_item_type *t = item->ci_type;
struct config_group *s = item->ci_group;
struct config_item *parent = item->ci_parent;
 
diff --git a/fs/configfs/symlink.c b/fs/configfs/symlink.c
index c8aabba..78ffc26 100644
--- a/fs/configfs/symlink.c
+++ b/fs/configfs/symlink.c
@@ -138,7 +138,7 @@ int configfs_symlink(struct inode *dir, struct dentry 
*dentry, const char *symna
struct configfs_dirent *sd;
struct config_item *parent_item;
struct config_item *target_item = NULL;
-   struct config_item_type *type;
+   const struct config_item_type *type;
 
sd = dentry->d_parent->d_fsdata;
/*
@@ -186,7 +186,7 @@ int configfs_u

[PATCH 0/2] [media] davinci: make function arguments and structures const

2017-10-17 Thread Bhumika Goyal
Make some function arguments as const. After this changes make ccdc_hw_device
structures as const.

Bhumika Goyal (2):
  [media] davinci: make function arguments const
  [media] davinci: make ccdc_hw_device structures const

 drivers/media/platform/davinci/ccdc_hw_device.h | 4 ++--
 drivers/media/platform/davinci/dm355_ccdc.c | 2 +-
 drivers/media/platform/davinci/dm644x_ccdc.c| 2 +-
 drivers/media/platform/davinci/isif.c   | 2 +-
 drivers/media/platform/davinci/vpfe_capture.c   | 6 +++---
 5 files changed, 8 insertions(+), 8 deletions(-)

-- 
1.9.1



[PATCH 1/2] [media] davinci: make function arguments const

2017-10-17 Thread Bhumika Goyal
Make the function arguments of functions vpfe_{register/unregister}_ccdc_device
const as the pointer dev does not modify the fields of the structure 
it points to. Also, declare the variable ccdc_dev const as it points to the 
same structure as dev but it does not modify the fields as well.

Signed-off-by: Bhumika Goyal 
---
 drivers/media/platform/davinci/ccdc_hw_device.h | 4 ++--
 drivers/media/platform/davinci/vpfe_capture.c   | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/media/platform/davinci/ccdc_hw_device.h 
b/drivers/media/platform/davinci/ccdc_hw_device.h
index f1b5210..3482178 100644
--- a/drivers/media/platform/davinci/ccdc_hw_device.h
+++ b/drivers/media/platform/davinci/ccdc_hw_device.h
@@ -82,8 +82,8 @@ struct ccdc_hw_device {
 };
 
 /* Used by CCDC module to register & unregister with vpfe capture driver */
-int vpfe_register_ccdc_device(struct ccdc_hw_device *dev);
-void vpfe_unregister_ccdc_device(struct ccdc_hw_device *dev);
+int vpfe_register_ccdc_device(const struct ccdc_hw_device *dev);
+void vpfe_unregister_ccdc_device(const struct ccdc_hw_device *dev);
 
 #endif
 #endif
diff --git a/drivers/media/platform/davinci/vpfe_capture.c 
b/drivers/media/platform/davinci/vpfe_capture.c
index 6792da1..7b3f6f8 100644
--- a/drivers/media/platform/davinci/vpfe_capture.c
+++ b/drivers/media/platform/davinci/vpfe_capture.c
@@ -115,7 +115,7 @@ struct ccdc_config {
 };
 
 /* ccdc device registered */
-static struct ccdc_hw_device *ccdc_dev;
+static const struct ccdc_hw_device *ccdc_dev;
 /* lock for accessing ccdc information */
 static DEFINE_MUTEX(ccdc_lock);
 /* ccdc configuration */
@@ -203,7 +203,7 @@ static const struct vpfe_pixel_format 
*vpfe_lookup_pix_format(u32 pix_format)
  * vpfe_register_ccdc_device. CCDC module calls this to
  * register with vpfe capture
  */
-int vpfe_register_ccdc_device(struct ccdc_hw_device *dev)
+int vpfe_register_ccdc_device(const struct ccdc_hw_device *dev)
 {
int ret = 0;
printk(KERN_NOTICE "vpfe_register_ccdc_device: %s\n", dev->name);
@@ -259,7 +259,7 @@ int vpfe_register_ccdc_device(struct ccdc_hw_device *dev)
  * vpfe_unregister_ccdc_device. CCDC module calls this to
  * unregister with vpfe capture
  */
-void vpfe_unregister_ccdc_device(struct ccdc_hw_device *dev)
+void vpfe_unregister_ccdc_device(const struct ccdc_hw_device *dev)
 {
if (!dev) {
printk(KERN_ERR "invalid ccdc device ptr\n");
-- 
1.9.1



[PATCH 2/2] [media] davinci: make ccdc_hw_device structures const

2017-10-17 Thread Bhumika Goyal
Make these structures const as they are only getting passed to the
functions vpfe_{register/unregister}_ccdc_device having the argument as
const.

Structures found using Coccinelle and changes done by hand.

Signed-off-by: Bhumika Goyal 
---
 drivers/media/platform/davinci/dm355_ccdc.c  | 2 +-
 drivers/media/platform/davinci/dm644x_ccdc.c | 2 +-
 drivers/media/platform/davinci/isif.c| 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/media/platform/davinci/dm355_ccdc.c 
b/drivers/media/platform/davinci/dm355_ccdc.c
index 6d492dc..89cb309 100644
--- a/drivers/media/platform/davinci/dm355_ccdc.c
+++ b/drivers/media/platform/davinci/dm355_ccdc.c
@@ -841,7 +841,7 @@ static int ccdc_set_hw_if_params(struct vpfe_hw_if_param 
*params)
return 0;
 }
 
-static struct ccdc_hw_device ccdc_hw_dev = {
+static const struct ccdc_hw_device ccdc_hw_dev = {
.name = "DM355 CCDC",
.owner = THIS_MODULE,
.hw_ops = {
diff --git a/drivers/media/platform/davinci/dm644x_ccdc.c 
b/drivers/media/platform/davinci/dm644x_ccdc.c
index 3b2d8a9..5fa0a1f 100644
--- a/drivers/media/platform/davinci/dm644x_ccdc.c
+++ b/drivers/media/platform/davinci/dm644x_ccdc.c
@@ -776,7 +776,7 @@ static void ccdc_restore_context(void)
regw(ccdc_ctx[CCDC_VP_OUT >> 2], CCDC_VP_OUT);
regw(ccdc_ctx[CCDC_PCR >> 2], CCDC_PCR);
 }
-static struct ccdc_hw_device ccdc_hw_dev = {
+static const struct ccdc_hw_device ccdc_hw_dev = {
.name = "DM6446 CCDC",
.owner = THIS_MODULE,
.hw_ops = {
diff --git a/drivers/media/platform/davinci/isif.c 
b/drivers/media/platform/davinci/isif.c
index 5813b49..d5ff584 100644
--- a/drivers/media/platform/davinci/isif.c
+++ b/drivers/media/platform/davinci/isif.c
@@ -1000,7 +1000,7 @@ static int isif_close(struct device *device)
return 0;
 }
 
-static struct ccdc_hw_device isif_hw_dev = {
+static const struct ccdc_hw_device isif_hw_dev = {
.name = "ISIF",
.owner = THIS_MODULE,
.hw_ops = {
-- 
1.9.1



[PATCH 2/2] CLK: SPEAr: make aux_clk_masks structures const

2017-10-17 Thread Bhumika Goyal
Make these const as they are either stored in the masks 'const' field
of a clk_aux structure or passed to the function clk_register_aux 
having the argument as const.

Signed-off-by: Bhumika Goyal 
---
 drivers/clk/spear/clk-aux-synth.c   | 2 +-
 drivers/clk/spear/spear1310_clock.c | 2 +-
 drivers/clk/spear/spear1340_clock.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/clk/spear/clk-aux-synth.c 
b/drivers/clk/spear/clk-aux-synth.c
index 8bea5df..2f145e3 100644
--- a/drivers/clk/spear/clk-aux-synth.c
+++ b/drivers/clk/spear/clk-aux-synth.c
@@ -29,7 +29,7 @@
 
 #define to_clk_aux(_hw) container_of(_hw, struct clk_aux, hw)
 
-static struct aux_clk_masks default_aux_masks = {
+static const  struct aux_clk_masks default_aux_masks = {
.eq_sel_mask = AUX_EQ_SEL_MASK,
.eq_sel_shift = AUX_EQ_SEL_SHIFT,
.eq1_mask = AUX_EQ1_SEL,
diff --git a/drivers/clk/spear/spear1310_clock.c 
b/drivers/clk/spear/spear1310_clock.c
index 2f86e3f..591248c 100644
--- a/drivers/clk/spear/spear1310_clock.c
+++ b/drivers/clk/spear/spear1310_clock.c
@@ -284,7 +284,7 @@
 };
 
 /* i2s prescaler1 masks */
-static struct aux_clk_masks i2s_prs1_masks = {
+static const struct aux_clk_masks i2s_prs1_masks = {
.eq_sel_mask = AUX_EQ_SEL_MASK,
.eq_sel_shift = SPEAR1310_I2S_PRS1_EQ_SEL_SHIFT,
.eq1_mask = AUX_EQ1_SEL,
diff --git a/drivers/clk/spear/spear1340_clock.c 
b/drivers/clk/spear/spear1340_clock.c
index cbb19a9..e5bc8c8 100644
--- a/drivers/clk/spear/spear1340_clock.c
+++ b/drivers/clk/spear/spear1340_clock.c
@@ -323,7 +323,7 @@
 };
 
 /* i2s prescaler1 masks */
-static struct aux_clk_masks i2s_prs1_masks = {
+static const struct aux_clk_masks i2s_prs1_masks = {
.eq_sel_mask = AUX_EQ_SEL_MASK,
.eq_sel_shift = SPEAR1340_I2S_PRS1_EQ_SEL_SHIFT,
.eq1_mask = AUX_EQ1_SEL,
-- 
1.9.1



[PATCH 0/2] CLK: SPEAr: make structure field, function arg and strutcure const

2017-10-17 Thread Bhumika Goyal
Make structure field and function argument as const. After this change, 
make the structures as const.

Bhumika Goyal (2):
  CLK: SPEAr: make structure field and function argument as const
  CLK: SPEAr: make aux_clk_masks structures const

 drivers/clk/spear/clk-aux-synth.c   | 4 ++--
 drivers/clk/spear/clk.h | 4 ++--
 drivers/clk/spear/spear1310_clock.c | 2 +-
 drivers/clk/spear/spear1340_clock.c | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

-- 
1.9.1



[PATCH 1/2] CLK: SPEAr: make structure field and function argument as const

2017-10-17 Thread Bhumika Goyal
Make the masks field of clk_aux structure const as it do not modify the
fields of the aux_clk_masks structure it points to.

Make the struct aux_clk_masks *aux argument of the function
clk_register_aux as const as the argument is only stored in the masks
field of a clk_aux structure which is now made const.

Signed-off-by: Bhumika Goyal 
---
 drivers/clk/spear/clk-aux-synth.c | 2 +-
 drivers/clk/spear/clk.h   | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/clk/spear/clk-aux-synth.c 
b/drivers/clk/spear/clk-aux-synth.c
index f271c35..8bea5df 100644
--- a/drivers/clk/spear/clk-aux-synth.c
+++ b/drivers/clk/spear/clk-aux-synth.c
@@ -136,7 +136,7 @@ static int clk_aux_set_rate(struct clk_hw *hw, unsigned 
long drate,
 
 struct clk *clk_register_aux(const char *aux_name, const char *gate_name,
const char *parent_name, unsigned long flags, void __iomem *reg,
-   struct aux_clk_masks *masks, struct aux_rate_tbl *rtbl,
+   const struct aux_clk_masks *masks, struct aux_rate_tbl *rtbl,
u8 rtbl_cnt, spinlock_t *lock, struct clk **gate_clk)
 {
struct clk_aux *aux;
diff --git a/drivers/clk/spear/clk.h b/drivers/clk/spear/clk.h
index 9834944..b9d28b3 100644
--- a/drivers/clk/spear/clk.h
+++ b/drivers/clk/spear/clk.h
@@ -49,7 +49,7 @@ struct aux_rate_tbl {
 struct clk_aux {
struct  clk_hw hw;
void __iomem*reg;
-   struct aux_clk_masks*masks;
+const struct aux_clk_masks *masks;
struct aux_rate_tbl *rtbl;
u8  rtbl_cnt;
spinlock_t  *lock;
@@ -112,7 +112,7 @@ typedef unsigned long (*clk_calc_rate)(struct clk_hw *hw, 
unsigned long prate,
 /* clk register routines */
 struct clk *clk_register_aux(const char *aux_name, const char *gate_name,
const char *parent_name, unsigned long flags, void __iomem *reg,
-   struct aux_clk_masks *masks, struct aux_rate_tbl *rtbl,
+   const struct aux_clk_masks *masks, struct aux_rate_tbl *rtbl,
u8 rtbl_cnt, spinlock_t *lock, struct clk **gate_clk);
 struct clk *clk_register_frac(const char *name, const char *parent_name,
unsigned long flags, void __iomem *reg,
-- 
1.9.1



[PATCH 4/4] SUNRPC: make cache_detail structures const

2017-10-17 Thread Bhumika Goyal
Make these const as they are only getting passed to the function
cache_create_net having the argument as const.

Signed-off-by: Bhumika Goyal 
---
 net/sunrpc/auth_gss/svcauth_gss.c | 4 ++--
 net/sunrpc/svcauth_unix.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/sunrpc/auth_gss/svcauth_gss.c 
b/net/sunrpc/auth_gss/svcauth_gss.c
index 7b1ee5a..e242cb4 100644
--- a/net/sunrpc/auth_gss/svcauth_gss.c
+++ b/net/sunrpc/auth_gss/svcauth_gss.c
@@ -264,7 +264,7 @@ static int rsi_parse(struct cache_detail *cd,
return status;
 }
 
-static struct cache_detail rsi_cache_template = {
+static const struct cache_detail rsi_cache_template = {
.owner  = THIS_MODULE,
.hash_size  = RSI_HASHMAX,
.name   = "auth.rpcsec.init",
@@ -524,7 +524,7 @@ static int rsc_parse(struct cache_detail *cd,
return status;
 }
 
-static struct cache_detail rsc_cache_template = {
+static const struct cache_detail rsc_cache_template = {
.owner  = THIS_MODULE,
.hash_size  = RSC_HASHMAX,
.name   = "auth.rpcsec.context",
diff --git a/net/sunrpc/svcauth_unix.c b/net/sunrpc/svcauth_unix.c
index f81eaa8..740b67d 100644
--- a/net/sunrpc/svcauth_unix.c
+++ b/net/sunrpc/svcauth_unix.c
@@ -569,7 +569,7 @@ static int unix_gid_show(struct seq_file *m,
return 0;
 }
 
-static struct cache_detail unix_gid_cache_template = {
+static const struct cache_detail unix_gid_cache_template = {
.owner  = THIS_MODULE,
.hash_size  = GID_HASHMAX,
.name   = "auth.unix.gid",
@@ -862,7 +862,7 @@ struct auth_ops svcauth_unix = {
.set_client = svcauth_unix_set_client,
 };
 
-static struct cache_detail ip_map_cache_template = {
+static const struct cache_detail ip_map_cache_template = {
.owner  = THIS_MODULE,
.hash_size  = IP_HASHMAX,
.name   = "auth.unix.ip",
-- 
1.9.1



[PATCH 0/4] make function arg and structures as const

2017-10-17 Thread Bhumika Goyal
Make the function argument as const. After thing change, make
the cache_detail structures as const.

Bhumika Goyal (4):
  sunrpc: make the function arg as const
  NFS: make cache_detail structures const
  NFSD: make cache_detail structures const
  SUNRPC: make cache_detail structures const

 fs/nfs/dns_resolve.c  | 2 +-
 fs/nfsd/export.c  | 4 ++--
 fs/nfsd/nfs4idmap.c   | 4 ++--
 include/linux/sunrpc/cache.h  | 2 +-
 net/sunrpc/auth_gss/svcauth_gss.c | 4 ++--
 net/sunrpc/cache.c| 2 +-
 net/sunrpc/svcauth_unix.c | 4 ++--
 7 files changed, 11 insertions(+), 11 deletions(-)

-- 
1.9.1



[PATCH 2/4] NFS: make cache_detail structure const

2017-10-17 Thread Bhumika Goyal
Make it const as it is only getting passed to the function
cache_create_net having the argument as const.

Signed-off-by: Bhumika Goyal 
---
 fs/nfs/dns_resolve.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/nfs/dns_resolve.c b/fs/nfs/dns_resolve.c
index d25f10f..477934a 100644
--- a/fs/nfs/dns_resolve.c
+++ b/fs/nfs/dns_resolve.c
@@ -353,7 +353,7 @@ ssize_t nfs_dns_resolve_name(struct net *net, char *name,
return ret;
 }
 
-static struct cache_detail nfs_dns_resolve_template = {
+static const struct cache_detail nfs_dns_resolve_template = {
.owner  = THIS_MODULE,
.hash_size  = NFS_DNS_HASHTBL_SIZE,
.name   = "dns_resolve",
-- 
1.9.1



[PATCH 3/4] NFSD: make cache_detail structures const

2017-10-17 Thread Bhumika Goyal
Make these const as they are only getting passed to the function
cache_create_net having the argument as const.

Signed-off-by: Bhumika Goyal 
---
 fs/nfsd/export.c| 4 ++--
 fs/nfsd/nfs4idmap.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
index 3bc08c3..06bb39c 100644
--- a/fs/nfsd/export.c
+++ b/fs/nfsd/export.c
@@ -231,7 +231,7 @@ static struct cache_head *expkey_alloc(void)
return NULL;
 }
 
-static struct cache_detail svc_expkey_cache_template = {
+static const struct cache_detail svc_expkey_cache_template = {
.owner  = THIS_MODULE,
.hash_size  = EXPKEY_HASHMAX,
.name   = "nfsd.fh",
@@ -747,7 +747,7 @@ static struct cache_head *svc_export_alloc(void)
return NULL;
 }
 
-static struct cache_detail svc_export_cache_template = {
+static const struct cache_detail svc_export_cache_template = {
.owner  = THIS_MODULE,
.hash_size  = EXPORT_HASHMAX,
.name   = "nfsd.export",
diff --git a/fs/nfsd/nfs4idmap.c b/fs/nfsd/nfs4idmap.c
index 6b9b6cc..a5bb765 100644
--- a/fs/nfsd/nfs4idmap.c
+++ b/fs/nfsd/nfs4idmap.c
@@ -178,7 +178,7 @@ struct ent {
 static struct ent *idtoname_update(struct cache_detail *, struct ent *,
   struct ent *);
 
-static struct cache_detail idtoname_cache_template = {
+static const struct cache_detail idtoname_cache_template = {
.owner  = THIS_MODULE,
.hash_size  = ENT_HASHMAX,
.name   = "nfs4.idtoname",
@@ -341,7 +341,7 @@ static struct ent *nametoid_update(struct cache_detail *, 
struct ent *,
   struct ent *);
 static int nametoid_parse(struct cache_detail *, char *, int);
 
-static struct cache_detail nametoid_cache_template = {
+static const struct cache_detail nametoid_cache_template = {
.owner  = THIS_MODULE,
.hash_size  = ENT_HASHMAX,
.name   = "nfs4.nametoid",
-- 
1.9.1



[PATCH 1/4] sunrpc: make the function arg as const

2017-10-17 Thread Bhumika Goyal
Make the struct cache_detail *tmpl argument of the function
cache_create_net as const as it is only getting passed to kmemup having
the argument as const void *.
Add const to the prototype too.

Signed-off-by: Bhumika Goyal 
---
 include/linux/sunrpc/cache.h | 2 +-
 net/sunrpc/cache.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h
index 270bad0..40d2822 100644
--- a/include/linux/sunrpc/cache.h
+++ b/include/linux/sunrpc/cache.h
@@ -213,7 +213,7 @@ extern int cache_check(struct cache_detail *detail,
 extern int cache_register_net(struct cache_detail *cd, struct net *net);
 extern void cache_unregister_net(struct cache_detail *cd, struct net *net);
 
-extern struct cache_detail *cache_create_net(struct cache_detail *tmpl, struct 
net *net);
+extern struct cache_detail *cache_create_net(const struct cache_detail *tmpl, 
struct net *net);
 extern void cache_destroy_net(struct cache_detail *cd, struct net *net);
 
 extern void sunrpc_init_cache_detail(struct cache_detail *cd);
diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c
index 79d55d9..e689438 100644
--- a/net/sunrpc/cache.c
+++ b/net/sunrpc/cache.c
@@ -1674,7 +1674,7 @@ void cache_unregister_net(struct cache_detail *cd, struct 
net *net)
 }
 EXPORT_SYMBOL_GPL(cache_unregister_net);
 
-struct cache_detail *cache_create_net(struct cache_detail *tmpl, struct net 
*net)
+struct cache_detail *cache_create_net(const struct cache_detail *tmpl, struct 
net *net)
 {
struct cache_detail *cd;
int i;
-- 
1.9.1



[PATCH] ALSA: declare snd_kcontrol_new structures as const

2017-05-27 Thread Bhumika Goyal
Declare snd_kcontrol_new structures as const as they are only passed an
argument to the function snd_ctl_new1. This argument is of type const,
so snd_kcontrol_new structures having this property can be made const.
Done using Coccinelle:

@r disable optional_qualifier@
identifier x;
position p;
@@
static struct snd_kcontrol_new x@p={...};

@ok@
identifier r.x;
position p;
@@
snd_ctl_new1(&x@p,...)

@bad@
position p != {r.p,ok.p};
identifier r.x;
@@
x@p

@depends on !bad disable optional_qualifier@
identifier r.x;
@@
+const
struct snd_kcontrol_new x;

Cross compiled these files:
sound/aoa/codecs/tas.c - powerpc
sound/mips/{hal2.c/sgio2audio.c} - mips
sound/ppc/{awacs.c/beep.c/tumbler.c} - powerpc
sound/soc/sh/siu_dai.c - sh
Could not find an architecture to compile sound/sh/aica.c.

Signed-off-by: Bhumika Goyal 
---
 sound/aoa/codecs/tas.c  | 14 +++---
 sound/aoa/fabrics/layout.c  |  8 
 sound/core/ctljack.c|  2 +-
 sound/drivers/vx/vx_mixer.c | 24 
 sound/firewire/bebob/bebob_maudio.c |  8 
 sound/mips/hal2.c   |  4 ++--
 sound/mips/sgio2audio.c | 14 +++---
 sound/pcmcia/vx/vxp_mixer.c |  4 ++--
 sound/ppc/awacs.c   |  4 ++--
 sound/ppc/beep.c|  2 +-
 sound/ppc/tumbler.c |  8 
 sound/sh/aica.c |  4 ++--
 sound/soc/sh/siu_dai.c  |  4 ++--
 sound/usb/mixer_quirks.c|  2 +-
 14 files changed, 51 insertions(+), 51 deletions(-)

diff --git a/sound/aoa/codecs/tas.c b/sound/aoa/codecs/tas.c
index 78ed1ff..733b636 100644
--- a/sound/aoa/codecs/tas.c
+++ b/sound/aoa/codecs/tas.c
@@ -271,7 +271,7 @@ static int tas_snd_vol_put(struct snd_kcontrol *kcontrol,
return 1;
 }
 
-static struct snd_kcontrol_new volume_control = {
+static const struct snd_kcontrol_new volume_control = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Master Playback Volume",
.access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
@@ -314,7 +314,7 @@ static int tas_snd_mute_put(struct snd_kcontrol *kcontrol,
return 1;
 }
 
-static struct snd_kcontrol_new mute_control = {
+static const struct snd_kcontrol_new mute_control = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Master Playback Switch",
.access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
@@ -426,7 +426,7 @@ static int tas_snd_drc_range_put(struct snd_kcontrol 
*kcontrol,
return 1;
 }
 
-static struct snd_kcontrol_new drc_range_control = {
+static const struct snd_kcontrol_new drc_range_control = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "DRC Range",
.access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
@@ -466,7 +466,7 @@ static int tas_snd_drc_switch_put(struct snd_kcontrol 
*kcontrol,
return 1;
 }
 
-static struct snd_kcontrol_new drc_switch_control = {
+static const struct snd_kcontrol_new drc_switch_control = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "DRC Range Switch",
.access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
@@ -524,7 +524,7 @@ static int tas_snd_capture_source_put(struct snd_kcontrol 
*kcontrol,
return 1;
 }
 
-static struct snd_kcontrol_new capture_source_control = {
+static const struct snd_kcontrol_new capture_source_control = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
/* If we name this 'Input Source', it properly shows up in
 * alsamixer as a selection, * but it's shown under the
@@ -586,7 +586,7 @@ static int tas_snd_treble_put(struct snd_kcontrol *kcontrol,
return 1;
 }
 
-static struct snd_kcontrol_new treble_control = {
+static const struct snd_kcontrol_new treble_control = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Treble",
.access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
@@ -637,7 +637,7 @@ static int tas_snd_bass_put(struct snd_kcontrol *kcontrol,
return 1;
 }
 
-static struct snd_kcontrol_new bass_control = {
+static const struct snd_kcontrol_new bass_control = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Bass",
.access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
diff --git a/sound/aoa/fabrics/layout.c b/sound/aoa/fabrics/layout.c
index a0c4a5d..1eddf8f 100644
--- a/sound/aoa/fabrics/layout.c
+++ b/sound/aoa/fabrics/layout.c
@@ -707,7 +707,7 @@ static int detect_choice_put(struct snd_kcontrol *kcontrol,
return 1;
 }
 
-static struct snd_kcontrol_new headphone_detect_choice = {
+static const struct snd_kcontrol_new headphone_detect_choice = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Headphone Detect Autoswitch",
.info = control_info,
@@ -717,7 +717,7 @@ static struct snd_kcontrol_new headphone_detect_choice = {
.private_value = 0,
 };
 
-static struct snd_kcontrol_new lineout_detect_choice = {
+static const stru

Re: [PATCH] ALSA: declare snd_kcontrol_new structures as const

2017-05-30 Thread Bhumika Goyal
On Tue, May 30, 2017 at 2:24 PM, Takashi Iwai  wrote:
> On Sat, 27 May 2017 16:46:15 +0200,
> Bhumika Goyal wrote:
>>
>> Declare snd_kcontrol_new structures as const as they are only passed an
>> argument to the function snd_ctl_new1. This argument is of type const,
>> so snd_kcontrol_new structures having this property can be made const.
>> Done using Coccinelle:
>>
>> @r disable optional_qualifier@
>> identifier x;
>> position p;
>> @@
>> static struct snd_kcontrol_new x@p={...};
>>
>> @ok@
>> identifier r.x;
>> position p;
>> @@
>> snd_ctl_new1(&x@p,...)
>>
>> @bad@
>> position p != {r.p,ok.p};
>> identifier r.x;
>> @@
>> x@p
>>
>> @depends on !bad disable optional_qualifier@
>> identifier r.x;
>> @@
>> +const
>> struct snd_kcontrol_new x;
>>
>> Cross compiled these files:
>> sound/aoa/codecs/tas.c - powerpc
>> sound/mips/{hal2.c/sgio2audio.c} - mips
>> sound/ppc/{awacs.c/beep.c/tumbler.c} - powerpc
>> sound/soc/sh/siu_dai.c - sh
>> Could not find an architecture to compile sound/sh/aica.c.
>>
>> Signed-off-by: Bhumika Goyal 
>
> Applied now, as it looks safe enough.  But I prefer splitting to
> individual patches, so please try to do that at the next time.
>
>

Okay :)

Thanks,
Bhumika

> thanks,
>
> Takashi


Re: [PATCH] ALSA: declare snd_kcontrol_new structures as const

2017-05-30 Thread Bhumika Goyal
On Tue, May 30, 2017 at 2:26 PM, Julia Lawall  wrote:
>
>
> On Tue, 30 May 2017, Takashi Iwai wrote:
>
>> On Sat, 27 May 2017 16:46:15 +0200,
>> Bhumika Goyal wrote:
>> >
>> > Declare snd_kcontrol_new structures as const as they are only passed an
>> > argument to the function snd_ctl_new1. This argument is of type const,
>> > so snd_kcontrol_new structures having this property can be made const.
>> > Done using Coccinelle:
>> >
>> > @r disable optional_qualifier@
>> > identifier x;
>> > position p;
>> > @@
>> > static struct snd_kcontrol_new x@p={...};
>> >
>> > @ok@
>> > identifier r.x;
>> > position p;
>> > @@
>> > snd_ctl_new1(&x@p,...)
>> >
>> > @bad@
>> > position p != {r.p,ok.p};
>> > identifier r.x;
>> > @@
>> > x@p
>> >
>> > @depends on !bad disable optional_qualifier@
>> > identifier r.x;
>> > @@
>> > +const
>> > struct snd_kcontrol_new x;
>> >
>> > Cross compiled these files:
>> > sound/aoa/codecs/tas.c - powerpc
>> > sound/mips/{hal2.c/sgio2audio.c} - mips
>> > sound/ppc/{awacs.c/beep.c/tumbler.c} - powerpc
>> > sound/soc/sh/siu_dai.c - sh
>> > Could not find an architecture to compile sound/sh/aica.c.
>> >
>> > Signed-off-by: Bhumika Goyal 
>>
>> Applied now, as it looks safe enough.  But I prefer splitting to
>> individual patches, so please try to do that at the next time.
>
> Individual patches in a series?
>

Yes, I think so. Takashi told to send a patchset for similar changes.

Thanks,
Bhumika

> julia


[PATCH 0/2] ACPI / PMIC: make some structures and function argument as const

2017-11-03 Thread Bhumika Goyal
Make some structures and the argument of the function 
intel_pmic_install_opregion_handler as const. After this change,
make the structures of type intel_pmic_opregion_data as const. 

Bhumika Goyal (2):
  ACPI / PMIC: Make some pointers, structure field and function argument
as const
  ACPI / PMIC: make intel_pmic_opregion_data structures const

 drivers/acpi/pmic/intel_pmic.c| 10 +-
 drivers/acpi/pmic/intel_pmic.h|  4 +++-
 drivers/acpi/pmic/intel_pmic_bxtwc.c  |  2 +-
 drivers/acpi/pmic/intel_pmic_chtwc.c  |  2 +-
 drivers/acpi/pmic/intel_pmic_crc.c|  2 +-
 drivers/acpi/pmic/intel_pmic_xpower.c |  2 +-
 6 files changed, 12 insertions(+), 10 deletions(-)

-- 
1.9.1



[PATCH 1/2] ACPI / PMIC: Make some pointers, structure field and function argument as const

2017-11-03 Thread Bhumika Goyal
Make some pointers of type intel_pmic_opregion_data as const as they
do not modify the fields of the structure they point too.
After this change, make the data field of intel_pmic_opregion
structure const as this data field is used for initializing the above pointers
that are now const.
Finally, make the struct intel_pmic_opregion_data * argument of the
function intel_pmic_install_opregion_handler as const as it is only
getting stored in the data field of the intel_pmic_opregion
structure which is now made const.

Signed-off-by: Bhumika Goyal 
---
 drivers/acpi/pmic/intel_pmic.c | 10 +-
 drivers/acpi/pmic/intel_pmic.h |  4 +++-
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/acpi/pmic/intel_pmic.c b/drivers/acpi/pmic/intel_pmic.c
index ca18e0d..553fa4f 100644
--- a/drivers/acpi/pmic/intel_pmic.c
+++ b/drivers/acpi/pmic/intel_pmic.c
@@ -32,7 +32,7 @@ struct intel_pmic_opregion {
struct mutex lock;
struct acpi_lpat_conversion_table *lpat_table;
struct regmap *regmap;
-   struct intel_pmic_opregion_data *data;
+   const struct intel_pmic_opregion_data *data;
struct intel_pmic_regs_handler_ctx ctx;
 };
 
@@ -58,7 +58,7 @@ static acpi_status intel_pmic_power_handler(u32 function,
 {
struct intel_pmic_opregion *opregion = region_context;
struct regmap *regmap = opregion->regmap;
-   struct intel_pmic_opregion_data *d = opregion->data;
+   const struct intel_pmic_opregion_data *d = opregion->data;
int reg, bit, result;
 
if (bits != 32 || !value64)
@@ -140,7 +140,7 @@ static int pmic_thermal_aux(struct intel_pmic_opregion 
*opregion, int reg,
 static int pmic_thermal_pen(struct intel_pmic_opregion *opregion, int reg,
int bit, u32 function, u64 *value)
 {
-   struct intel_pmic_opregion_data *d = opregion->data;
+   const struct intel_pmic_opregion_data *d = opregion->data;
struct regmap *regmap = opregion->regmap;
 
if (!d->get_policy || !d->update_policy)
@@ -176,7 +176,7 @@ static acpi_status intel_pmic_thermal_handler(u32 function,
void *handler_context, void *region_context)
 {
struct intel_pmic_opregion *opregion = region_context;
-   struct intel_pmic_opregion_data *d = opregion->data;
+   const struct intel_pmic_opregion_data *d = opregion->data;
int reg, bit, result;
 
if (bits != 32 || !value64)
@@ -255,7 +255,7 @@ static acpi_status intel_pmic_regs_handler(u32 function,
 
 int intel_pmic_install_opregion_handler(struct device *dev, acpi_handle handle,
struct regmap *regmap,
-   struct intel_pmic_opregion_data *d)
+   const struct intel_pmic_opregion_data 
*d)
 {
acpi_status status;
struct intel_pmic_opregion *opregion;
diff --git a/drivers/acpi/pmic/intel_pmic.h b/drivers/acpi/pmic/intel_pmic.h
index e8bfa7b..754b7bd 100644
--- a/drivers/acpi/pmic/intel_pmic.h
+++ b/drivers/acpi/pmic/intel_pmic.h
@@ -20,6 +20,8 @@ struct intel_pmic_opregion_data {
int thermal_table_count;
 };
 
-int intel_pmic_install_opregion_handler(struct device *dev, acpi_handle 
handle, struct regmap *regmap, struct intel_pmic_opregion_data *d);
+int intel_pmic_install_opregion_handler(struct device *dev, acpi_handle handle,
+   struct regmap *regmap,
+   const struct intel_pmic_opregion_data 
*d);
 
 #endif
-- 
1.9.1



[PATCH 2/2] ACPI / PMIC: make intel_pmic_opregion_data structures const

2017-11-03 Thread Bhumika Goyal
Make these structures as const as they are only passed to the function
intel_pmic_install_opregion_handler having the argument as const.

Signed-off-by: Bhumika Goyal 
---
 drivers/acpi/pmic/intel_pmic_bxtwc.c  | 2 +-
 drivers/acpi/pmic/intel_pmic_chtwc.c  | 2 +-
 drivers/acpi/pmic/intel_pmic_crc.c| 2 +-
 drivers/acpi/pmic/intel_pmic_xpower.c | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/acpi/pmic/intel_pmic_bxtwc.c 
b/drivers/acpi/pmic/intel_pmic_bxtwc.c
index 90011aa..fd698c6 100644
--- a/drivers/acpi/pmic/intel_pmic_bxtwc.c
+++ b/drivers/acpi/pmic/intel_pmic_bxtwc.c
@@ -377,7 +377,7 @@ static int intel_bxtwc_pmic_get_raw_temp(struct regmap 
*regmap, int reg)
return regmap_update_bits(regmap, reg, mask, val);
 }
 
-static struct intel_pmic_opregion_data intel_bxtwc_pmic_opregion_data = {
+static const struct intel_pmic_opregion_data intel_bxtwc_pmic_opregion_data = {
.get_power  = intel_bxtwc_pmic_get_power,
.update_power   = intel_bxtwc_pmic_update_power,
.get_raw_temp   = intel_bxtwc_pmic_get_raw_temp,
diff --git a/drivers/acpi/pmic/intel_pmic_chtwc.c 
b/drivers/acpi/pmic/intel_pmic_chtwc.c
index 85636d7..240359b 100644
--- a/drivers/acpi/pmic/intel_pmic_chtwc.c
+++ b/drivers/acpi/pmic/intel_pmic_chtwc.c
@@ -243,7 +243,7 @@ static int intel_cht_wc_pmic_update_power(struct regmap 
*regmap, int reg,
  * The thermal table and ops are empty, we do not support the Thermal opregion
  * (DPTF) due to lacking documentation.
  */
-static struct intel_pmic_opregion_data intel_cht_wc_pmic_opregion_data = {
+static const struct intel_pmic_opregion_data intel_cht_wc_pmic_opregion_data = 
{
.get_power  = intel_cht_wc_pmic_get_power,
.update_power   = intel_cht_wc_pmic_update_power,
.power_table= power_table,
diff --git a/drivers/acpi/pmic/intel_pmic_crc.c 
b/drivers/acpi/pmic/intel_pmic_crc.c
index d7f1761..cad1fe1 100644
--- a/drivers/acpi/pmic/intel_pmic_crc.c
+++ b/drivers/acpi/pmic/intel_pmic_crc.c
@@ -174,7 +174,7 @@ static int intel_crc_pmic_update_policy(struct regmap 
*regmap,
return 0;
 }
 
-static struct intel_pmic_opregion_data intel_crc_pmic_opregion_data = {
+static const struct intel_pmic_opregion_data intel_crc_pmic_opregion_data = {
.get_power  = intel_crc_pmic_get_power,
.update_power   = intel_crc_pmic_update_power,
.get_raw_temp   = intel_crc_pmic_get_raw_temp,
diff --git a/drivers/acpi/pmic/intel_pmic_xpower.c 
b/drivers/acpi/pmic/intel_pmic_xpower.c
index 6c99d3f..96718af 100644
--- a/drivers/acpi/pmic/intel_pmic_xpower.c
+++ b/drivers/acpi/pmic/intel_pmic_xpower.c
@@ -231,7 +231,7 @@ static int intel_xpower_pmic_get_raw_temp(struct regmap 
*regmap, int reg)
return ret;
 }
 
-static struct intel_pmic_opregion_data intel_xpower_pmic_opregion_data = {
+static const struct intel_pmic_opregion_data intel_xpower_pmic_opregion_data = 
{
.get_power = intel_xpower_pmic_get_power,
.update_power = intel_xpower_pmic_update_power,
.get_raw_temp = intel_xpower_pmic_get_raw_temp,
-- 
1.9.1



[PATCH 1/2] ARM: OMAP2+: CM: make some pointers and function arguments as const

2017-11-06 Thread Bhumika Goyal
Make the pointer cm_ll_data of type cm_ll_data as const as it does not
modify the fields of the structure it points too.
After this change, make the argument of cm_register function as const as
it is used to initialise cm_ll_data or used inside an if condition.
Make the pointer argument of cm_unregister function as const as it is only
used inside an if condition.
Add const to the function prototypes too.

Signed-off-by: Bhumika Goyal 
---
 arch/arm/mach-omap2/cm.h| 4 ++--
 arch/arm/mach-omap2/cm_common.c | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-omap2/cm.h b/arch/arm/mach-omap2/cm.h
index e833984..7b66e17 100644
--- a/arch/arm/mach-omap2/cm.h
+++ b/arch/arm/mach-omap2/cm.h
@@ -72,8 +72,8 @@ int omap_cm_wait_module_idle(u8 part, s16 prcm_mod, u16 
idlest_reg,
 u8 idlest_shift);
 int omap_cm_module_enable(u8 mode, u8 part, u16 inst, u16 clkctrl_offs);
 int omap_cm_module_disable(u8 part, u16 inst, u16 clkctrl_offs);
-extern int cm_register(struct cm_ll_data *cld);
-extern int cm_unregister(struct cm_ll_data *cld);
+extern int cm_register(const struct cm_ll_data *cld);
+extern int cm_unregister(const struct cm_ll_data *cld);
 int omap_cm_init(void);
 int omap2_cm_base_init(void);
 
diff --git a/arch/arm/mach-omap2/cm_common.c b/arch/arm/mach-omap2/cm_common.c
index 83c6fa7..adf8858 100644
--- a/arch/arm/mach-omap2/cm_common.c
+++ b/arch/arm/mach-omap2/cm_common.c
@@ -29,7 +29,7 @@
  * common CM functions
  */
 static struct cm_ll_data null_cm_ll_data;
-static struct cm_ll_data *cm_ll_data = &null_cm_ll_data;
+static const struct cm_ll_data *cm_ll_data = &null_cm_ll_data;
 
 /* cm_base: base virtual address of the CM IP block */
 struct omap_domain_base cm_base;
@@ -189,7 +189,7 @@ int omap_cm_module_disable(u8 part, u16 inst, u16 
clkctrl_offs)
  * is NULL, or -EEXIST if cm_register() has already been called
  * without an intervening cm_unregister().
  */
-int cm_register(struct cm_ll_data *cld)
+int cm_register(const struct cm_ll_data *cld)
 {
if (!cld)
return -EINVAL;
@@ -213,7 +213,7 @@ int cm_register(struct cm_ll_data *cld)
  * -EINVAL if @cld is NULL or if @cld does not match the struct
  * cm_ll_data * previously registered by cm_register().
  */
-int cm_unregister(struct cm_ll_data *cld)
+int cm_unregister(const struct cm_ll_data *cld)
 {
if (!cld || cm_ll_data != cld)
return -EINVAL;
-- 
1.9.1



[PATCH 0/2] ARM: OMAP2+: CM: make some structures, function arguments and pointers as const

2017-11-06 Thread Bhumika Goyal
Make some pointers and function arguments as const. After this change,
make the structures of type cm_ll_data as const.

Bhumika Goyal (2):
  ARM: OMAP2+: CM: make some pointers and function arguments as const
  ARM: OMAP2+: CM: make cm_ll_data structures as const

 arch/arm/mach-omap2/cm.h | 4 ++--
 arch/arm/mach-omap2/cm2xxx.c | 2 +-
 arch/arm/mach-omap2/cm33xx.c | 2 +-
 arch/arm/mach-omap2/cm3xxx.c | 2 +-
 arch/arm/mach-omap2/cm_common.c  | 6 +++---
 arch/arm/mach-omap2/cminst44xx.c | 2 +-
 6 files changed, 9 insertions(+), 9 deletions(-)

-- 
1.9.1



[PATCH 2/2] ARM: OMAP2+: CM: make cm_ll_data structures as const

2017-11-06 Thread Bhumika Goyal
Make these const as they are only getting passed to the functions
cm_register and cm_unregister having the arguments as const.

Signed-off-by: Bhumika Goyal 
---
 arch/arm/mach-omap2/cm2xxx.c | 2 +-
 arch/arm/mach-omap2/cm33xx.c | 2 +-
 arch/arm/mach-omap2/cm3xxx.c | 2 +-
 arch/arm/mach-omap2/cminst44xx.c | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-omap2/cm2xxx.c b/arch/arm/mach-omap2/cm2xxx.c
index cd90b4c..d5b87f4 100644
--- a/arch/arm/mach-omap2/cm2xxx.c
+++ b/arch/arm/mach-omap2/cm2xxx.c
@@ -385,7 +385,7 @@ void omap2xxx_cm_set_mod_dividers(u32 mpu, u32 dsp, u32 
gfx, u32 core, u32 mdm)
  *
  */
 
-static struct cm_ll_data omap2xxx_cm_ll_data = {
+static const struct cm_ll_data omap2xxx_cm_ll_data = {
.split_idlest_reg   = &omap2xxx_cm_split_idlest_reg,
.wait_module_ready  = &omap2xxx_cm_wait_module_ready,
 };
diff --git a/arch/arm/mach-omap2/cm33xx.c b/arch/arm/mach-omap2/cm33xx.c
index a9e08d8..0c9750f 100644
--- a/arch/arm/mach-omap2/cm33xx.c
+++ b/arch/arm/mach-omap2/cm33xx.c
@@ -342,7 +342,7 @@ struct clkdm_ops am33xx_clkdm_operations = {
.clkdm_clk_disable  = am33xx_clkdm_clk_disable,
 };
 
-static struct cm_ll_data am33xx_cm_ll_data = {
+static const struct cm_ll_data am33xx_cm_ll_data = {
.wait_module_ready  = &am33xx_cm_wait_module_ready,
.wait_module_idle   = &am33xx_cm_wait_module_idle,
.module_enable  = &am33xx_cm_module_enable,
diff --git a/arch/arm/mach-omap2/cm3xxx.c b/arch/arm/mach-omap2/cm3xxx.c
index 961bc47..ec580fd 100644
--- a/arch/arm/mach-omap2/cm3xxx.c
+++ b/arch/arm/mach-omap2/cm3xxx.c
@@ -662,7 +662,7 @@ void omap3_cm_save_scratchpad_contents(u32 *ptr)
  *
  */
 
-static struct cm_ll_data omap3xxx_cm_ll_data = {
+static const struct cm_ll_data omap3xxx_cm_ll_data = {
.split_idlest_reg   = &omap3xxx_cm_split_idlest_reg,
.wait_module_ready  = &omap3xxx_cm_wait_module_ready,
 };
diff --git a/arch/arm/mach-omap2/cminst44xx.c b/arch/arm/mach-omap2/cminst44xx.c
index 8774e98..2e2274f 100644
--- a/arch/arm/mach-omap2/cminst44xx.c
+++ b/arch/arm/mach-omap2/cminst44xx.c
@@ -512,7 +512,7 @@ struct clkdm_ops am43xx_clkdm_operations = {
.clkdm_xlate_address= omap4_clkdm_xlate_address,
 };
 
-static struct cm_ll_data omap4xxx_cm_ll_data = {
+static const struct cm_ll_data omap4xxx_cm_ll_data = {
.wait_module_ready  = &omap4_cminst_wait_module_ready,
.wait_module_idle   = &omap4_cminst_wait_module_idle,
.module_enable  = &omap4_cminst_module_enable,
-- 
1.9.1



[PATCH 0/2] cpufreq: arm_big_little: make function arguments and structures const

2017-10-19 Thread Bhumika Goyal
Make some function arguments as const. After this change make the 
cpufreq_arm_bL_ops structures const.

Bhumika Goyal (2):
  cpufreq: arm_big_little: make function argument and structure const
  cpufreq: arm_big_little: make cpufreq_arm_bL_ops structures const

 drivers/cpufreq/arm_big_little.c   | 6 +++---
 drivers/cpufreq/arm_big_little.h   | 4 ++--
 drivers/cpufreq/arm_big_little_dt.c| 2 +-
 drivers/cpufreq/scpi-cpufreq.c | 2 +-
 drivers/cpufreq/vexpress-spc-cpufreq.c | 2 +-
 5 files changed, 8 insertions(+), 8 deletions(-)

-- 
1.9.1



[PATCH 2/2] cpufreq: arm_big_little: make cpufreq_arm_bL_ops structures const

2017-10-19 Thread Bhumika Goyal
Make these const as they are only getting passed to the functions
bL_cpufreq_{register/unregister} having the arguments as const.

Signed-off-by: Bhumika Goyal 
---
 drivers/cpufreq/arm_big_little_dt.c| 2 +-
 drivers/cpufreq/scpi-cpufreq.c | 2 +-
 drivers/cpufreq/vexpress-spc-cpufreq.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/cpufreq/arm_big_little_dt.c 
b/drivers/cpufreq/arm_big_little_dt.c
index 39b3f51..b944f29 100644
--- a/drivers/cpufreq/arm_big_little_dt.c
+++ b/drivers/cpufreq/arm_big_little_dt.c
@@ -61,7 +61,7 @@ static int dt_get_transition_latency(struct device *cpu_dev)
return transition_latency;
 }
 
-static struct cpufreq_arm_bL_ops dt_bL_ops = {
+static const struct cpufreq_arm_bL_ops dt_bL_ops = {
.name   = "dt-bl",
.get_transition_latency = dt_get_transition_latency,
.init_opp_table = dev_pm_opp_of_cpumask_add_table,
diff --git a/drivers/cpufreq/scpi-cpufreq.c b/drivers/cpufreq/scpi-cpufreq.c
index 8de2364..05d2990 100644
--- a/drivers/cpufreq/scpi-cpufreq.c
+++ b/drivers/cpufreq/scpi-cpufreq.c
@@ -53,7 +53,7 @@ static int scpi_init_opp_table(const struct cpumask *cpumask)
return ret;
 }
 
-static struct cpufreq_arm_bL_ops scpi_cpufreq_ops = {
+static const struct cpufreq_arm_bL_ops scpi_cpufreq_ops = {
.name   = "scpi",
.get_transition_latency = scpi_get_transition_latency,
.init_opp_table = scpi_init_opp_table,
diff --git a/drivers/cpufreq/vexpress-spc-cpufreq.c 
b/drivers/cpufreq/vexpress-spc-cpufreq.c
index 87e5bdc..5323728 100644
--- a/drivers/cpufreq/vexpress-spc-cpufreq.c
+++ b/drivers/cpufreq/vexpress-spc-cpufreq.c
@@ -42,7 +42,7 @@ static int ve_spc_get_transition_latency(struct device 
*cpu_dev)
return 100; /* 1 ms */
 }
 
-static struct cpufreq_arm_bL_ops ve_spc_cpufreq_ops = {
+static const struct cpufreq_arm_bL_ops ve_spc_cpufreq_ops = {
.name   = "vexpress-spc",
.get_transition_latency = ve_spc_get_transition_latency,
.init_opp_table = ve_spc_init_opp_table,
-- 
1.9.1



  1   2   3   4   5   6   7   >