提交 6ba79b85 编写于 作者: T Takashi Iwai

ALSA: rawmidi: Add const to snd_rawmidi_ops

Make snd_rawmidi_substream.ops to be a const pointer to be safer and
allow more optimization.  The patches to constify each rawmidi ops
will follow.
Reviewed-by: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
上级 46a049da
...@@ -103,7 +103,7 @@ struct snd_rawmidi_substream { ...@@ -103,7 +103,7 @@ struct snd_rawmidi_substream {
struct snd_rawmidi_runtime *runtime; struct snd_rawmidi_runtime *runtime;
struct pid *pid; struct pid *pid;
/* hardware layer */ /* hardware layer */
struct snd_rawmidi_ops *ops; const struct snd_rawmidi_ops *ops;
}; };
struct snd_rawmidi_file { struct snd_rawmidi_file {
...@@ -155,7 +155,7 @@ int snd_rawmidi_new(struct snd_card *card, char *id, int device, ...@@ -155,7 +155,7 @@ int snd_rawmidi_new(struct snd_card *card, char *id, int device,
int output_count, int input_count, int output_count, int input_count,
struct snd_rawmidi **rmidi); struct snd_rawmidi **rmidi);
void snd_rawmidi_set_ops(struct snd_rawmidi *rmidi, int stream, void snd_rawmidi_set_ops(struct snd_rawmidi *rmidi, int stream,
struct snd_rawmidi_ops *ops); const struct snd_rawmidi_ops *ops);
/* callbacks */ /* callbacks */
......
...@@ -1749,7 +1749,7 @@ static int snd_rawmidi_dev_disconnect(struct snd_device *device) ...@@ -1749,7 +1749,7 @@ static int snd_rawmidi_dev_disconnect(struct snd_device *device)
* Sets the rawmidi operators for the given stream direction. * Sets the rawmidi operators for the given stream direction.
*/ */
void snd_rawmidi_set_ops(struct snd_rawmidi *rmidi, int stream, void snd_rawmidi_set_ops(struct snd_rawmidi *rmidi, int stream,
struct snd_rawmidi_ops *ops) const struct snd_rawmidi_ops *ops)
{ {
struct snd_rawmidi_substream *substream; struct snd_rawmidi_substream *substream;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册