* [PATCH] ALSA: oxfw: enclose identifiers referred by single function for scs1x feature
@ 2017-01-13 11:30 Takashi Sakamoto
2017-01-14 8:32 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: Takashi Sakamoto @ 2017-01-13 11:30 UTC (permalink / raw)
To: clemens, tiwai; +Cc: alsa-devel
Some identifiers are referred just by one functions. In this case, they
can be put into the function definition. This brings two merits; readers
can easily follow codes related to the identifiers, developers are free
from name conflict.
This commit moves such identifiers to each function definition.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
---
sound/firewire/oxfw/oxfw-scs1x.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/sound/firewire/oxfw/oxfw-scs1x.c b/sound/firewire/oxfw/oxfw-scs1x.c
index 7940058..93209eb 100644
--- a/sound/firewire/oxfw/oxfw-scs1x.c
+++ b/sound/firewire/oxfw/oxfw-scs1x.c
@@ -338,12 +338,6 @@ static void midi_playback_drain(struct snd_rawmidi_substream *stream)
wait_event(scs->idle_wait, scs->output_idle);
}
-static const struct snd_rawmidi_ops midi_playback_ops = {
- .open = midi_playback_open,
- .close = midi_playback_close,
- .trigger = midi_playback_trigger,
- .drain = midi_playback_drain,
-};
static int register_address(struct snd_oxfw *oxfw)
{
struct fw_scs1x *scs = oxfw->spec;
@@ -369,6 +363,12 @@ void snd_oxfw_scs1x_update(struct snd_oxfw *oxfw)
int snd_oxfw_scs1x_add(struct snd_oxfw *oxfw)
{
+ static const struct snd_rawmidi_ops midi_playback_ops = {
+ .open = midi_playback_open,
+ .close = midi_playback_close,
+ .trigger = midi_playback_trigger,
+ .drain = midi_playback_drain,
+ };
struct snd_rawmidi *rmidi;
struct fw_scs1x *scs;
int err;
--
2.9.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ALSA: oxfw: enclose identifiers referred by single function for scs1x feature
2017-01-13 11:30 [PATCH] ALSA: oxfw: enclose identifiers referred by single function for scs1x feature Takashi Sakamoto
@ 2017-01-14 8:32 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2017-01-14 8:32 UTC (permalink / raw)
To: Takashi Sakamoto; +Cc: alsa-devel, clemens
On Fri, 13 Jan 2017 12:30:22 +0100,
Takashi Sakamoto wrote:
>
> Some identifiers are referred just by one functions. In this case, they
> can be put into the function definition. This brings two merits; readers
> can easily follow codes related to the identifiers, developers are free
> from name conflict.
>
> This commit moves such identifiers to each function definition.
>
> Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Applied, thanks.
Takashi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-01-14 8:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-13 11:30 [PATCH] ALSA: oxfw: enclose identifiers referred by single function for scs1x feature Takashi Sakamoto
2017-01-14 8:32 ` Takashi Iwai
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.