Skip to content

Commit

Permalink
ALSA: sparc: constify snd_pcm_ops structures
Browse files Browse the repository at this point in the history
snd_pcm_ops are not supposed to change at runtime. All functions
working with snd_pcm_ops provided by <sound/pcm.h> work with
const snd_pcm_ops. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Arvind Yadav authored and Takashi Iwai committed Aug 19, 2017
1 parent 46a085a commit 544d627
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions sound/sparc/amd7930.c
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ static int snd_amd7930_hw_free(struct snd_pcm_substream *substream)
return snd_pcm_lib_free_pages(substream);
}

static struct snd_pcm_ops snd_amd7930_playback_ops = {
static const struct snd_pcm_ops snd_amd7930_playback_ops = {
.open = snd_amd7930_playback_open,
.close = snd_amd7930_playback_close,
.ioctl = snd_pcm_lib_ioctl,
Expand All @@ -744,7 +744,7 @@ static struct snd_pcm_ops snd_amd7930_playback_ops = {
.pointer = snd_amd7930_playback_pointer,
};

static struct snd_pcm_ops snd_amd7930_capture_ops = {
static const struct snd_pcm_ops snd_amd7930_capture_ops = {
.open = snd_amd7930_capture_open,
.close = snd_amd7930_capture_close,
.ioctl = snd_pcm_lib_ioctl,
Expand Down
4 changes: 2 additions & 2 deletions sound/sparc/cs4231.c
Original file line number Diff line number Diff line change
Expand Up @@ -1203,7 +1203,7 @@ static int snd_cs4231_capture_close(struct snd_pcm_substream *substream)
* XXX the audio AUXIO register...
*/

static struct snd_pcm_ops snd_cs4231_playback_ops = {
static const struct snd_pcm_ops snd_cs4231_playback_ops = {
.open = snd_cs4231_playback_open,
.close = snd_cs4231_playback_close,
.ioctl = snd_pcm_lib_ioctl,
Expand All @@ -1214,7 +1214,7 @@ static struct snd_pcm_ops snd_cs4231_playback_ops = {
.pointer = snd_cs4231_playback_pointer,
};

static struct snd_pcm_ops snd_cs4231_capture_ops = {
static const struct snd_pcm_ops snd_cs4231_capture_ops = {
.open = snd_cs4231_capture_open,
.close = snd_cs4231_capture_close,
.ioctl = snd_pcm_lib_ioctl,
Expand Down
2 changes: 1 addition & 1 deletion sound/sparc/dbri.c
Original file line number Diff line number Diff line change
Expand Up @@ -2213,7 +2213,7 @@ static snd_pcm_uframes_t snd_dbri_pointer(struct snd_pcm_substream *substream)
return ret;
}

static struct snd_pcm_ops snd_dbri_ops = {
static const struct snd_pcm_ops snd_dbri_ops = {
.open = snd_dbri_open,
.close = snd_dbri_close,
.ioctl = snd_pcm_lib_ioctl,
Expand Down

0 comments on commit 544d627

Please sign in to comment.