Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1709513

[PATCH 7/9] ALSA: sb16: constify snd_pcm_ops structures

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Arvind Yadav <arvind.yadav.cs@gmail.com>
Newsgroups linux.kernel
Subject [PATCH 7/9] ALSA: sb16: constify snd_pcm_ops structures
Date Fri, 11 Aug 2017 14:00:02 +0200
Message-ID <udgLE-34p-23@gated-at.bofh.it> (permalink)
References <udgLD-34p-3@gated-at.bofh.it>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Mb8ogyXzy4eziiB0rQjz3P2AiX2Qf/IkI4a4efsoTdI=; b=t6HIG6TxHwFtZISX58Vwij9CFnS8+TE24YfqzGkb25eQpx2vF/jBg9xMuVcFgNIuaZ OIwiZb1dHzk4WRFVPWwKCjMLeEd+m02ol2kC7SJIqodeS+xdG84puMYnhK3vVtaH+0UT sgsWZ6px3006RM6Y0IWuDWws9+tIz+1240wCwGA5rb97koRcfIL0O8GfeBhEdjEG7nz4 cBNgsTIn76Fx1ajzNd9qhA6d4bGFsm1e+clsdfHYY4czNu+VeRVQzkcp6xFU+uQJBZi1 x1l9Fi0A1uGxdT2/YL/LFIvx2Ob72ycqBQJPCLRcQVG+24NPCYvBcuF41fcf6zXJUsc8 h9AA==
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Mb8ogyXzy4eziiB0rQjz3P2AiX2Qf/IkI4a4efsoTdI=; b=bhiVNIrrWqj/b+M1fzjIhOwdjQe4M9wWayCwN8k+Yn4URvkCJAoEShdpEsIFGUNKzp rQy8DmzkYNT7tVI5+qX650JX9RhqCvE6izAgm0FpyAp7b21gTJ8oq+mMznrhPeVAGYGX dp+0ckz/7GW7b/lC5WF9kZ6Wq04nnzPBuwYeUTDnxhWDWz6sXQAuu/x9LIg+Hj58vxv2 Jrz1WWRLQlpa3K8k+g9oLLEHXyVUYIe9M6bsxxazMhO/3J7fIhMZIHQxxC6Nmj2psYPi g3weNf3WXxNXIqIVKxDVTQ49CRFWLBThxhAZKzScDxHaM/SXT9nJD1SyItQlhmEt093w zq0g==
X-Gm-Message-State AHYfb5g6ZpcXWS/V+dMzWM8DR6wypOh8EIERJey6fU1/ojkw5EircYvi nQS95q6GXAllBg==
X-Received by 10.98.31.7 with SMTP id f7mr16219228pff.27.1502452734971; Fri, 11 Aug 2017 04:58:54 -0700 (PDT)
X-Mailer git-send-email 1.9.1
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 33
Organization linux.* mail to news gateway
X-Original-Cc alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
X-Original-Date Fri, 11 Aug 2017 17:28:05 +0530
X-Original-Message-ID <1502452687-8202-8-git-send-email-arvind.yadav.cs@gmail.com>
X-Original-References <1502452687-8202-1-git-send-email-arvind.yadav.cs@gmail.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1709513

Show key headers only | View raw


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>
---
 sound/isa/sb/sb16_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/isa/sb/sb16_main.c b/sound/isa/sb/sb16_main.c
index 4be1350..6fc6325 100644
--- a/sound/isa/sb/sb16_main.c
+++ b/sound/isa/sb/sb16_main.c
@@ -838,7 +838,7 @@ int snd_sb16dsp_configure(struct snd_sb * chip)
 	return 0;
 }
 
-static struct snd_pcm_ops snd_sb16_playback_ops = {
+static const struct snd_pcm_ops snd_sb16_playback_ops = {
 	.open =		snd_sb16_playback_open,
 	.close =	snd_sb16_playback_close,
 	.ioctl =	snd_pcm_lib_ioctl,
@@ -849,7 +849,7 @@ int snd_sb16dsp_configure(struct snd_sb * chip)
 	.pointer =	snd_sb16_playback_pointer,
 };
 
-static struct snd_pcm_ops snd_sb16_capture_ops = {
+static const struct snd_pcm_ops snd_sb16_capture_ops = {
 	.open =		snd_sb16_capture_open,
 	.close =	snd_sb16_capture_close,
 	.ioctl =	snd_pcm_lib_ioctl,
-- 
1.9.1

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/9] constify isa snd_pcm_ops structures Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-11 14:00 +0200
  [PATCH 1/9] ALSA: ad1816a: constify snd_pcm_ops structures Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-11 14:00 +0200
  [PATCH 7/9] ALSA: sb16: constify snd_pcm_ops structures Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-11 14:00 +0200
  [PATCH 9/9] ALSA: wss: constify snd_pcm_ops structures Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-11 14:00 +0200
  [PATCH 3/9] ALSA: es18xx: constify snd_pcm_ops structures Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-11 14:00 +0200
  [PATCH 5/9] ALSA: msnd: constify snd_pcm_ops structures Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-11 14:00 +0200
  [PATCH 4/9] ALSA: gus: constify snd_pcm_ops structures Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-11 14:10 +0200
  [PATCH 2/9] ALSA: es1688: constify snd_pcm_ops structures Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-11 14:10 +0200
  Re: [PATCH 0/9] constify isa snd_pcm_ops structures Takashi Iwai <tiwai@suse.de> - 2017-08-12 23:50 +0200

csiph-web