[alsa-devel] [PATCH 00/12] fixes for firewire topic branch
![](https://secure.gravatar.com/avatar/6ad2911cf7f4e6ac971062aeaaaf334d.jpg?s=120&d=mm&r=g)
This series of patch is to fix this patchset: [PATCH 00/49 v4] Enhancement for support of Firewire devices http://mailman.alsa-project.org/pipermail/alsa-devel/2014-April/075841.html
After the patchset was merged into firewire topic branch, kbuild test backend reports some warnings. And I found some bugs and minor issues by myself.
If you want to see fixup for each patch in the patchset, please see: http://mailman.alsa-project.org/pipermail/alsa-devel/2014-May/077140.html
Takashi Sakamoto (12): firewire-lib: Use ARRAY_SIZE() instead of sizeof() for correct loop limit firewire-lib: Fix sparse warning of incorrect type in assignment fireworks: Fix wrong value as argument for PTR_ERR() fireworks: Use the same prototype for functions as actual declaration fireworks/bebob: Change type of argument for sampling rate fireworks/bebob: Use the same type of variables as function parameters fireworks/bebob: Add suffix for long long integer literal fireworks/bebob: Improve indentation bebob: Use different names for identifiers in the same file bebob: Add static specifier to identifier with file scope bebob: Remove meaningless mutex_unlock() bebob: Improve comments about stream format
sound/firewire/amdtp.c | 4 ++-- sound/firewire/bebob/bebob.c | 9 ++++----- sound/firewire/bebob/bebob.h | 6 +++--- sound/firewire/bebob/bebob_focusrite.c | 24 ++++++++++++------------ sound/firewire/bebob/bebob_maudio.c | 4 ++-- sound/firewire/bebob/bebob_midi.c | 4 ++-- sound/firewire/bebob/bebob_stream.c | 7 ++++--- sound/firewire/bebob/bebob_terratec.c | 6 +++--- sound/firewire/cmp.c | 4 +++- sound/firewire/fireworks/fireworks.h | 5 +++-- sound/firewire/fireworks/fireworks_hwdep.c | 2 +- sound/firewire/fireworks/fireworks_midi.c | 4 ++-- sound/firewire/fireworks/fireworks_pcm.c | 4 ++-- sound/firewire/fireworks/fireworks_stream.c | 2 +- sound/firewire/fireworks/fireworks_transaction.c | 4 ++-- 15 files changed, 46 insertions(+), 43 deletions(-)
![](https://secure.gravatar.com/avatar/6ad2911cf7f4e6ac971062aeaaaf334d.jpg?s=120&d=mm&r=g)
This commit fixes a big for loop count with array. The limitation of loop count should be calcurated with the number of elements in the array, not with the number of bytes.
Aditionally, this commit apply the same declaration as a prototype in header for the array.
Signed-off-by: Takashi Sakamoto o-takashi@sakamocchi.jp --- sound/firewire/amdtp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/firewire/amdtp.c b/sound/firewire/amdtp.c index e573f25..31dd1cf 100644 --- a/sound/firewire/amdtp.c +++ b/sound/firewire/amdtp.c @@ -107,7 +107,7 @@ const unsigned int amdtp_syt_intervals[CIP_SFC_COUNT] = { }; EXPORT_SYMBOL(amdtp_syt_intervals);
-const unsigned int amdtp_rate_table[] = { +const unsigned int amdtp_rate_table[CIP_SFC_COUNT] = { [CIP_SFC_32000] = 32000, [CIP_SFC_44100] = 44100, [CIP_SFC_48000] = 48000, @@ -198,7 +198,7 @@ void amdtp_stream_set_parameters(struct amdtp_stream *s, WARN_ON(midi_channels > AMDTP_MAX_CHANNELS_FOR_MIDI)) return;
- for (sfc = 0; sfc < sizeof(amdtp_rate_table); ++sfc) + for (sfc = 0; sfc < ARRAY_SIZE(amdtp_rate_table); ++sfc) if (amdtp_rate_table[sfc] == rate) goto sfc_found; WARN_ON(1);
![](https://secure.gravatar.com/avatar/6ad2911cf7f4e6ac971062aeaaaf334d.jpg?s=120&d=mm&r=g)
__be32 value should not be assigned directly to bool value.
Signed-off-by: Takashi Sakamoto o-takashi@sakamocchi.jp --- sound/firewire/cmp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/sound/firewire/cmp.c b/sound/firewire/cmp.c index d31a403..ba8df5a 100644 --- a/sound/firewire/cmp.c +++ b/sound/firewire/cmp.c @@ -164,7 +164,9 @@ int cmp_connection_check_used(struct cmp_connection *c, bool *used) c->resources.unit, TCODE_READ_QUADLET_REQUEST, pcr_address(c), &pcr, 4, 0); if (err >= 0) - *used = (pcr & cpu_to_be32(PCR_BCAST_CONN | PCR_P2P_CONN_MASK)); + *used = !!(pcr & cpu_to_be32(PCR_BCAST_CONN | + PCR_P2P_CONN_MASK)); + return err; } EXPORT_SYMBOL(cmp_connection_check_used);
![](https://secure.gravatar.com/avatar/6ad2911cf7f4e6ac971062aeaaaf334d.jpg?s=120&d=mm&r=g)
The return value of memdup_user() should be passed to return correct error.
Signed-off-by: Takashi Sakamoto o-takashi@sakamocchi.jp --- sound/firewire/fireworks/fireworks_hwdep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/firewire/fireworks/fireworks_hwdep.c b/sound/firewire/fireworks/fireworks_hwdep.c index 6b50a67..4f8216f 100644 --- a/sound/firewire/fireworks/fireworks_hwdep.c +++ b/sound/firewire/fireworks/fireworks_hwdep.c @@ -135,7 +135,7 @@ hwdep_write(struct snd_hwdep *hwdep, const char __user *data, long count,
buf = memdup_user(data, count); if (IS_ERR(buf)) - return PTR_ERR(data); + return PTR_ERR(buf);
/* check seqnum is not for kernel-land */ seqnum = be32_to_cpu(((struct snd_efw_transaction *)buf)->seqnum);
![](https://secure.gravatar.com/avatar/6ad2911cf7f4e6ac971062aeaaaf334d.jpg?s=120&d=mm&r=g)
There are two modes for Fireworks, IEC 61883 compliant or Windows. So it's better to use enum type instead of int to express the intension, even if C language specification defines to handle enum variables as usual integer.
Signed-off-by: Takashi Sakamoto o-takashi@sakamocchi.jp --- sound/firewire/fireworks/fireworks.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sound/firewire/fireworks/fireworks.h b/sound/firewire/fireworks/fireworks.h index 494195b..14395e3 100644 --- a/sound/firewire/fireworks/fireworks.h +++ b/sound/firewire/fireworks/fireworks.h @@ -192,7 +192,8 @@ enum snd_efw_transport_mode { }; int snd_efw_command_set_resp_addr(struct snd_efw *efw, u16 addr_high, u32 addr_low); -int snd_efw_command_set_tx_mode(struct snd_efw *efw, unsigned int mode); +int snd_efw_command_set_tx_mode(struct snd_efw *efw, + enum snd_efw_transport_mode mode); int snd_efw_command_get_hwinfo(struct snd_efw *efw, struct snd_efw_hwinfo *hwinfo); int snd_efw_command_get_phys_meters(struct snd_efw *efw,
![](https://secure.gravatar.com/avatar/6ad2911cf7f4e6ac971062aeaaaf334d.jpg?s=120&d=mm&r=g)
Originally, I intent to this argument given with 'struct snd_pcm_runtime.rate' or params_rate(). They return value of 'unsigned int'. So 'unsigned int' is better for the type of this argument.
Signed-off-by: Takashi Sakamoto o-takashi@sakamocchi.jp --- sound/firewire/bebob/bebob.h | 2 +- sound/firewire/bebob/bebob_stream.c | 2 +- sound/firewire/fireworks/fireworks.h | 2 +- sound/firewire/fireworks/fireworks_stream.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/sound/firewire/bebob/bebob.h b/sound/firewire/bebob/bebob.h index 91b26b0..6aef152 100644 --- a/sound/firewire/bebob/bebob.h +++ b/sound/firewire/bebob/bebob.h @@ -211,7 +211,7 @@ int snd_bebob_stream_discover(struct snd_bebob *bebob); int snd_bebob_stream_map(struct snd_bebob *bebob, struct amdtp_stream *stream); int snd_bebob_stream_init_duplex(struct snd_bebob *bebob); -int snd_bebob_stream_start_duplex(struct snd_bebob *bebob, int rate); +int snd_bebob_stream_start_duplex(struct snd_bebob *bebob, unsigned int rate); void snd_bebob_stream_stop_duplex(struct snd_bebob *bebob); void snd_bebob_stream_update_duplex(struct snd_bebob *bebob); void snd_bebob_stream_destroy_duplex(struct snd_bebob *bebob); diff --git a/sound/firewire/bebob/bebob_stream.c b/sound/firewire/bebob/bebob_stream.c index 452e936..fbe938c 100644 --- a/sound/firewire/bebob/bebob_stream.c +++ b/sound/firewire/bebob/bebob_stream.c @@ -483,7 +483,7 @@ end: return err; }
-int snd_bebob_stream_start_duplex(struct snd_bebob *bebob, int rate) +int snd_bebob_stream_start_duplex(struct snd_bebob *bebob, unsigned int rate) { struct snd_bebob_rate_spec *rate_spec = bebob->spec->rate; struct amdtp_stream *master, *slave; diff --git a/sound/firewire/fireworks/fireworks.h b/sound/firewire/fireworks/fireworks.h index 14395e3..d2b36be 100644 --- a/sound/firewire/fireworks/fireworks.h +++ b/sound/firewire/fireworks/fireworks.h @@ -205,7 +205,7 @@ int snd_efw_command_get_sampling_rate(struct snd_efw *efw, unsigned int *rate); int snd_efw_command_set_sampling_rate(struct snd_efw *efw, unsigned int rate);
int snd_efw_stream_init_duplex(struct snd_efw *efw); -int snd_efw_stream_start_duplex(struct snd_efw *efw, int sampling_rate); +int snd_efw_stream_start_duplex(struct snd_efw *efw, unsigned int rate); void snd_efw_stream_stop_duplex(struct snd_efw *efw); void snd_efw_stream_update_duplex(struct snd_efw *efw); void snd_efw_stream_destroy_duplex(struct snd_efw *efw); diff --git a/sound/firewire/fireworks/fireworks_stream.c b/sound/firewire/fireworks/fireworks_stream.c index eaab8f6..5415690 100644 --- a/sound/firewire/fireworks/fireworks_stream.c +++ b/sound/firewire/fireworks/fireworks_stream.c @@ -195,7 +195,7 @@ end: return err; }
-int snd_efw_stream_start_duplex(struct snd_efw *efw, int rate) +int snd_efw_stream_start_duplex(struct snd_efw *efw, unsigned int rate) { struct amdtp_stream *master, *slave; atomic_t *slave_substreams;
![](https://secure.gravatar.com/avatar/6ad2911cf7f4e6ac971062aeaaaf334d.jpg?s=120&d=mm&r=g)
The second argument of snd_efw_command_get_sampling_rate() means sampling rate and its type is 'unsigned int'. But 'int' variable is passed as parameter. It's better to apply the same type for the variable as its argument.
Similally, the type of variable for snd_efw_command_get_clock_source() and avc_bridgeco_get_plug_type() should be the same type as each argument.
Signed-off-by: Takashi Sakamoto o-takashi@sakamocchi.jp --- sound/firewire/bebob/bebob_stream.c | 3 ++- sound/firewire/fireworks/fireworks_pcm.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/sound/firewire/bebob/bebob_stream.c b/sound/firewire/bebob/bebob_stream.c index fbe938c..38aee33 100644 --- a/sound/firewire/bebob/bebob_stream.c +++ b/sound/firewire/bebob/bebob_stream.c @@ -852,7 +852,8 @@ static int seek_msu_sync_input_plug(struct snd_bebob *bebob) { u8 plugs[AVC_PLUG_INFO_BUF_BYTES], addr[AVC_BRIDGECO_ADDR_BYTES]; - unsigned int i, type; + unsigned int i; + enum avc_bridgeco_plug_type type; int err;
/* Get the number of Music Sub Unit for both direction. */ diff --git a/sound/firewire/fireworks/fireworks_pcm.c b/sound/firewire/fireworks/fireworks_pcm.c index ed211d0..8a34753 100644 --- a/sound/firewire/fireworks/fireworks_pcm.c +++ b/sound/firewire/fireworks/fireworks_pcm.c @@ -195,8 +195,8 @@ end: static int pcm_open(struct snd_pcm_substream *substream) { struct snd_efw *efw = substream->private_data; - int sampling_rate; - unsigned int clock_source; + unsigned int sampling_rate; + enum snd_efw_clock_source clock_source; int err;
err = snd_efw_stream_lock_try(efw);
![](https://secure.gravatar.com/avatar/6ad2911cf7f4e6ac971062aeaaaf334d.jpg?s=120&d=mm&r=g)
This commit adds suffix to register values of each device, to supress 'sparse' warnings. Additionally, this commit changes offset values with integer literal.
Signed-off-by: Takashi Sakamoto o-takashi@sakamocchi.jp --- sound/firewire/bebob/bebob.h | 4 ++-- sound/firewire/bebob/bebob_focusrite.c | 20 ++++++++++---------- sound/firewire/bebob/bebob_maudio.c | 4 ++-- sound/firewire/fireworks/fireworks_transaction.c | 4 ++-- 4 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/sound/firewire/bebob/bebob.h b/sound/firewire/bebob/bebob.h index 6aef152..d1c93a1 100644 --- a/sound/firewire/bebob/bebob.h +++ b/sound/firewire/bebob/bebob.h @@ -35,8 +35,8 @@ #include "../cmp.h"
/* basic register addresses on DM1000/DM1100/DM1500 */ -#define BEBOB_ADDR_REG_INFO 0xffffc8020000 -#define BEBOB_ADDR_REG_REQ 0xffffc8021000 +#define BEBOB_ADDR_REG_INFO 0xffffc8020000ULL +#define BEBOB_ADDR_REG_REQ 0xffffc8021000ULL
struct snd_bebob;
diff --git a/sound/firewire/bebob/bebob_focusrite.c b/sound/firewire/bebob/bebob_focusrite.c index cd29dbc..e71066d 100644 --- a/sound/firewire/bebob/bebob_focusrite.c +++ b/sound/firewire/bebob/bebob_focusrite.c @@ -14,15 +14,15 @@ #define DIG_OUT "Digital Out" #define STM_IN "Stream In"
-#define SAFFIRE_ADDRESS_BASE 0x000100000000 +#define SAFFIRE_ADDRESS_BASE 0x000100000000ULL
-#define SAFFIRE_OFFSET_CLOCK_SOURCE 0x0000000000f8 -#define SAFFIREPRO_OFFSET_CLOCK_SOURCE 0x000000000174 +#define SAFFIRE_OFFSET_CLOCK_SOURCE 0x00f8 +#define SAFFIREPRO_OFFSET_CLOCK_SOURCE 0x0174
/* whether sync to external device or not */ -#define SAFFIRE_OFFSET_CLOCK_SYNC_EXT 0x00000000013c -#define SAFFIRE_LE_OFFSET_CLOCK_SYNC_EXT 0x000000000432 -#define SAFFIREPRO_OFFSET_CLOCK_SYNC_EXT 0x000000000164 +#define SAFFIRE_OFFSET_CLOCK_SYNC_EXT 0x013c +#define SAFFIRE_LE_OFFSET_CLOCK_SYNC_EXT 0x0432 +#define SAFFIREPRO_OFFSET_CLOCK_SYNC_EXT 0x0164
#define SAFFIRE_CLOCK_SOURCE_INTERNAL 0 #define SAFFIRE_CLOCK_SOURCE_SPDIF 1 @@ -35,10 +35,10 @@ #define SAFFIREPRO_CLOCK_SOURCE_WORDCLOCK 5
/* S/PDIF, ADAT1, ADAT2 is enabled or not. three quadlets */ -#define SAFFIREPRO_ENABLE_DIG_IFACES 0x0000000001a4 +#define SAFFIREPRO_ENABLE_DIG_IFACES 0x01a4
/* saffirepro has its own parameter for sampling frequency */ -#define SAFFIREPRO_RATE_NOREBOOT 0x0000000001cc +#define SAFFIREPRO_RATE_NOREBOOT 0x01cc /* index is the value for this register */ static const unsigned int rates[] = { [0] = 0, @@ -51,8 +51,8 @@ static const unsigned int rates[] = { };
/* saffire(no label)/saffire LE has metering */ -#define SAFFIRE_OFFSET_METER 0x000000000100 -#define SAFFIRE_LE_OFFSET_METER 0x000000000168 +#define SAFFIRE_OFFSET_METER 0x0100 +#define SAFFIRE_LE_OFFSET_METER 0x0168
static inline int saffire_read_block(struct snd_bebob *bebob, u64 offset, diff --git a/sound/firewire/bebob/bebob_maudio.c b/sound/firewire/bebob/bebob_maudio.c index 52b1a40..6af50eb 100644 --- a/sound/firewire/bebob/bebob_maudio.c +++ b/sound/firewire/bebob/bebob_maudio.c @@ -49,7 +49,7 @@ /* padding */ #define MAUDIO_BOOTLOADER_CUE3 0x00000000
-#define MAUDIO_SPECIFIC_ADDRESS 0xffc700000000 +#define MAUDIO_SPECIFIC_ADDRESS 0xffc700000000ULL
#define METER_OFFSET 0x00600000
@@ -111,7 +111,7 @@ int snd_bebob_maudio_load_firmware(struct fw_unit *unit) * firmware version 5058 or later has date later than "20070401", but * 'date' is not null-terminated. */ - if (date < 0x3230303730343031) { + if (date < 0x3230303730343031LL) { dev_err(&unit->device, "Use firmware version 5058 or later\n"); err = -ENOSYS; diff --git a/sound/firewire/fireworks/fireworks_transaction.c b/sound/firewire/fireworks/fireworks_transaction.c index 81a65eb..aa56b8a 100644 --- a/sound/firewire/fireworks/fireworks_transaction.c +++ b/sound/firewire/fireworks/fireworks_transaction.c @@ -31,8 +31,8 @@ */ #include "./fireworks.h"
-#define MEMORY_SPACE_EFW_COMMAND 0xecc000000000 -#define MEMORY_SPACE_EFW_RESPONSE 0xecc080000000 +#define MEMORY_SPACE_EFW_COMMAND 0xecc000000000ULL +#define MEMORY_SPACE_EFW_RESPONSE 0xecc080000000ULL
#define ERROR_RETRIES 3 #define ERROR_DELAY_MS 5
![](https://secure.gravatar.com/avatar/6ad2911cf7f4e6ac971062aeaaaf334d.jpg?s=120&d=mm&r=g)
According to coding rule.
Signed-off-by: Takashi Sakamoto o-takashi@sakamocchi.jp --- sound/firewire/bebob/bebob_midi.c | 4 ++-- sound/firewire/fireworks/fireworks_midi.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/sound/firewire/bebob/bebob_midi.c b/sound/firewire/bebob/bebob_midi.c index c04cea2..63343d5 100644 --- a/sound/firewire/bebob/bebob_midi.c +++ b/sound/firewire/bebob/bebob_midi.c @@ -143,7 +143,7 @@ int snd_bebob_create_midi_devices(struct snd_bebob *bebob) rmidi->info_flags |= SNDRV_RAWMIDI_INFO_INPUT;
snd_rawmidi_set_ops(rmidi, SNDRV_RAWMIDI_STREAM_INPUT, - &midi_capture_ops); + &midi_capture_ops);
str = &rmidi->streams[SNDRV_RAWMIDI_STREAM_INPUT];
@@ -154,7 +154,7 @@ int snd_bebob_create_midi_devices(struct snd_bebob *bebob) rmidi->info_flags |= SNDRV_RAWMIDI_INFO_OUTPUT;
snd_rawmidi_set_ops(rmidi, SNDRV_RAWMIDI_STREAM_OUTPUT, - &midi_playback_ops); + &midi_playback_ops);
str = &rmidi->streams[SNDRV_RAWMIDI_STREAM_OUTPUT];
diff --git a/sound/firewire/fireworks/fireworks_midi.c b/sound/firewire/fireworks/fireworks_midi.c index 4a600d2..cf9c652 100644 --- a/sound/firewire/fireworks/fireworks_midi.c +++ b/sound/firewire/fireworks/fireworks_midi.c @@ -143,7 +143,7 @@ int snd_efw_create_midi_devices(struct snd_efw *efw) rmidi->info_flags |= SNDRV_RAWMIDI_INFO_INPUT;
snd_rawmidi_set_ops(rmidi, SNDRV_RAWMIDI_STREAM_INPUT, - &midi_capture_ops); + &midi_capture_ops);
str = &rmidi->streams[SNDRV_RAWMIDI_STREAM_INPUT];
@@ -154,7 +154,7 @@ int snd_efw_create_midi_devices(struct snd_efw *efw) rmidi->info_flags |= SNDRV_RAWMIDI_INFO_OUTPUT;
snd_rawmidi_set_ops(rmidi, SNDRV_RAWMIDI_STREAM_OUTPUT, - &midi_playback_ops); + &midi_playback_ops);
str = &rmidi->streams[SNDRV_RAWMIDI_STREAM_OUTPUT];
![](https://secure.gravatar.com/avatar/6ad2911cf7f4e6ac971062aeaaaf334d.jpg?s=120&d=mm&r=g)
To suppress 'sparse' warning.
Signed-off-by: Takashi Sakamoto o-takashi@sakamocchi.jp --- sound/firewire/bebob/bebob.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sound/firewire/bebob/bebob.c b/sound/firewire/bebob/bebob.c index 31b96b7..b5e8f99 100644 --- a/sound/firewire/bebob/bebob.c +++ b/sound/firewire/bebob/bebob.c @@ -69,7 +69,7 @@ name_device(struct snd_bebob *bebob, unsigned int vendor_id) struct fw_device *fw_dev = fw_parent_device(bebob->unit); char vendor[24] = {0}; char model[32] = {0}; - u32 id; + u32 hw_id; u32 data[2] = {0}; u32 revision; int err; @@ -88,7 +88,7 @@ name_device(struct snd_bebob *bebob, unsigned int vendor_id)
/* get hardware id */ err = snd_bebob_read_quad(bebob->unit, INFO_OFFSET_HW_MODEL_ID, - &id); + &hw_id); if (err < 0) goto end;
@@ -109,7 +109,7 @@ name_device(struct snd_bebob *bebob, unsigned int vendor_id) strcpy(bebob->card->mixername, model); snprintf(bebob->card->longname, sizeof(bebob->card->longname), "%s %s (id:%d, rev:%d), GUID %08x%08x at %s, S%d", - vendor, model, id, revision, + vendor, model, hw_id, revision, data[0], data[1], dev_name(&bebob->unit->device), 100 << fw_dev->max_speed); end:
![](https://secure.gravatar.com/avatar/6ad2911cf7f4e6ac971062aeaaaf334d.jpg?s=120&d=mm&r=g)
Some variables were declared without static even if they're not referred to from external files. This commit make them local symbols for better information-hiding by file unit.
Signed-off-by: Takashi Sakamoto o-takashi@sakamocchi.jp --- sound/firewire/bebob/bebob.c | 2 +- sound/firewire/bebob/bebob_focusrite.c | 4 ++-- sound/firewire/bebob/bebob_terratec.c | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/sound/firewire/bebob/bebob.c b/sound/firewire/bebob/bebob.c index b5e8f99..0e9d625 100644 --- a/sound/firewire/bebob/bebob.c +++ b/sound/firewire/bebob/bebob.c @@ -313,7 +313,7 @@ static void bebob_remove(struct fw_unit *unit) snd_card_free_when_closed(bebob->card); }
-struct snd_bebob_rate_spec normal_rate_spec = { +static struct snd_bebob_rate_spec normal_rate_spec = { .get = &snd_bebob_stream_get_rate, .set = &snd_bebob_stream_set_rate }; diff --git a/sound/firewire/bebob/bebob_focusrite.c b/sound/firewire/bebob/bebob_focusrite.c index e71066d..45a0eed 100644 --- a/sound/firewire/bebob/bebob_focusrite.c +++ b/sound/firewire/bebob/bebob_focusrite.c @@ -256,7 +256,7 @@ static struct snd_bebob_clock_spec saffire_both_clk_spec = { .get = &saffire_both_clk_src_get, }; /* Saffire LE */ -struct snd_bebob_meter_spec saffire_le_meter_spec = { +static struct snd_bebob_meter_spec saffire_le_meter_spec = { .num = ARRAY_SIZE(saffire_le_meter_labels), .labels = saffire_le_meter_labels, .get = &saffire_meter_get, @@ -267,7 +267,7 @@ struct snd_bebob_spec saffire_le_spec = { .meter = &saffire_le_meter_spec }; /* Saffire */ -struct snd_bebob_meter_spec saffire_meter_spec = { +static struct snd_bebob_meter_spec saffire_meter_spec = { .num = ARRAY_SIZE(saffire_meter_labels), .labels = saffire_meter_labels, .get = &saffire_meter_get, diff --git a/sound/firewire/bebob/bebob_terratec.c b/sound/firewire/bebob/bebob_terratec.c index 2a89c1c..eef8ea7 100644 --- a/sound/firewire/bebob/bebob_terratec.c +++ b/sound/firewire/bebob/bebob_terratec.c @@ -38,13 +38,13 @@ phase24_series_clk_src_get(struct snd_bebob *bebob, unsigned int *id) return avc_audio_get_selector(bebob->unit, 0, 4, id); }
-struct snd_bebob_rate_spec phase_series_rate_spec = { +static struct snd_bebob_rate_spec phase_series_rate_spec = { .get = &snd_bebob_stream_get_rate, .set = &snd_bebob_stream_set_rate, };
/* PHASE 88 Rack FW */ -struct snd_bebob_clock_spec phase88_rack_clk = { +static struct snd_bebob_clock_spec phase88_rack_clk = { .num = ARRAY_SIZE(phase88_rack_clk_src_labels), .labels = phase88_rack_clk_src_labels, .get = &phase88_rack_clk_src_get, @@ -56,7 +56,7 @@ struct snd_bebob_spec phase88_rack_spec = { };
/* 'PHASE 24 FW' and 'PHASE X24 FW' */ -struct snd_bebob_clock_spec phase24_series_clk = { +static struct snd_bebob_clock_spec phase24_series_clk = { .num = ARRAY_SIZE(phase24_series_clk_src_labels), .labels = phase24_series_clk_src_labels, .get = &phase24_series_clk_src_get,
![](https://secure.gravatar.com/avatar/6ad2911cf7f4e6ac971062aeaaaf334d.jpg?s=120&d=mm&r=g)
Currently mutex_unlock() is called in module's cleanup function. But after cleaned up, this mutex is automatically released. So this function call is meaningless.
Signed-off-by: Takashi Sakamoto o-takashi@sakamocchi.jp --- sound/firewire/bebob/bebob.c | 1 - 1 file changed, 1 deletion(-)
diff --git a/sound/firewire/bebob/bebob.c b/sound/firewire/bebob/bebob.c index 0e9d625..fc19c99 100644 --- a/sound/firewire/bebob/bebob.c +++ b/sound/firewire/bebob/bebob.c @@ -465,7 +465,6 @@ static void __exit snd_bebob_exit(void) { driver_unregister(&bebob_driver.driver); - mutex_destroy(&devices_mutex); }
module_init(snd_bebob_init);
![](https://secure.gravatar.com/avatar/6ad2911cf7f4e6ac971062aeaaaf334d.jpg?s=120&d=mm&r=g)
Currently bebob driver apply Raw Audio Data channel (in IEC 61883-1:2002, Multi Bit Linear Audio Data channel in IEC 61883-6:20005) to IEC 60958 Conformant Data channel because both fireworks and bebob based devices can handle it by ignoring each label.
This patch improves a comment about this.
Signed-off-by: Takashi Sakamoto o-takashi@sakamocchi.jp --- sound/firewire/bebob/bebob_stream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/firewire/bebob/bebob_stream.c b/sound/firewire/bebob/bebob_stream.c index 38aee33..514c7c9 100644 --- a/sound/firewire/bebob/bebob_stream.c +++ b/sound/firewire/bebob/bebob_stream.c @@ -760,7 +760,7 @@ parse_stream_formation(u8 *buf, unsigned int len, format = buf[6 + e * 2];
switch (format) { - /* IEC 60958-3, currently handle as MBLA */ + /* IEC 60958 Conformant, currently handled as MBLA */ case 0x00: /* Multi bit linear audio */ case 0x06: /* Raw */
![](https://secure.gravatar.com/avatar/5b19e9d0e834ea10ef75803718ad564b.jpg?s=120&d=mm&r=g)
At Wed, 28 May 2014 00:14:35 +0900, Takashi Sakamoto wrote:
This series of patch is to fix this patchset: [PATCH 00/49 v4] Enhancement for support of Firewire devices http://mailman.alsa-project.org/pipermail/alsa-devel/2014-April/075841.html
After the patchset was merged into firewire topic branch, kbuild test backend reports some warnings. And I found some bugs and minor issues by myself.
If you want to see fixup for each patch in the patchset, please see: http://mailman.alsa-project.org/pipermail/alsa-devel/2014-May/077140.html
Takashi Sakamoto (12): firewire-lib: Use ARRAY_SIZE() instead of sizeof() for correct loop limit firewire-lib: Fix sparse warning of incorrect type in assignment fireworks: Fix wrong value as argument for PTR_ERR() fireworks: Use the same prototype for functions as actual declaration fireworks/bebob: Change type of argument for sampling rate fireworks/bebob: Use the same type of variables as function parameters fireworks/bebob: Add suffix for long long integer literal fireworks/bebob: Improve indentation bebob: Use different names for identifiers in the same file bebob: Add static specifier to identifier with file scope bebob: Remove meaningless mutex_unlock() bebob: Improve comments about stream format
Thanks, applied all patches now.
Takashi
sound/firewire/amdtp.c | 4 ++-- sound/firewire/bebob/bebob.c | 9 ++++----- sound/firewire/bebob/bebob.h | 6 +++--- sound/firewire/bebob/bebob_focusrite.c | 24 ++++++++++++------------ sound/firewire/bebob/bebob_maudio.c | 4 ++-- sound/firewire/bebob/bebob_midi.c | 4 ++-- sound/firewire/bebob/bebob_stream.c | 7 ++++--- sound/firewire/bebob/bebob_terratec.c | 6 +++--- sound/firewire/cmp.c | 4 +++- sound/firewire/fireworks/fireworks.h | 5 +++-- sound/firewire/fireworks/fireworks_hwdep.c | 2 +- sound/firewire/fireworks/fireworks_midi.c | 4 ++-- sound/firewire/fireworks/fireworks_pcm.c | 4 ++-- sound/firewire/fireworks/fireworks_stream.c | 2 +- sound/firewire/fireworks/fireworks_transaction.c | 4 ++-- 15 files changed, 46 insertions(+), 43 deletions(-)
-- 1.8.3.2
participants (2)
-
Takashi Iwai
-
Takashi Sakamoto