[alsa-devel] [PATCH v2 03/13] ALSA: dice: add proc node for stream formation

Takashi Sakamoto o-takashi at sakamocchi.jp
Tue May 1 05:06:05 CEST 2018


Hi,

On May 1 2018 00:12, Takashi Iwai wrote:
> On Sun, 29 Apr 2018 08:50:22 +0200,
> Takashi Sakamoto wrote:
>>
>> Products with DICE interface in market can support variable stream
>> formats for three levels of sampling transmission frequencies. To
>> record these formats, a proxy structure got several fields in former
>> commit.
>>
>> This commit adds a proc node to output the stream formats for debugging
>> purpose.
>>
>> Signed-off-by: Takashi Sakamoto <o-takashi at sakamocchi.jp>
>> ---
>>   sound/firewire/dice/dice-proc.c | 35 +++++++++++++++++++++++++++++++++++
>>   1 file changed, 35 insertions(+)
>>
>> diff --git a/sound/firewire/dice/dice-proc.c b/sound/firewire/dice/dice-proc.c
>> index 43b130b7aa07..f967e0ec7598 100644
>> --- a/sound/firewire/dice/dice-proc.c
>> +++ b/sound/firewire/dice/dice-proc.c
>> @@ -243,6 +243,40 @@ static void dice_proc_read(struct snd_info_entry *entry,
>>   	}
>>   }
>>   
>> +static void dice_proc_read_formation(struct snd_info_entry *entry,
>> +				     struct snd_info_buffer *buffer)
>> +{
>> +	static const char *const rate_labels[] = {
>> +		[0] = "low",
>> +		[1] = "middle",
>> +		[2] = "high",
>> +	};
> 
> This doesn't look smart :)
> 
> How about defining these three numbers as constants (or macros)?
> Also the magic number 3 appearing everywhere can be defined properly,
> too.

Indeed. I was a bit rude. I'm OK to utilize constants for this purpose.


Thanks

Takashi Sakamoto


More information about the Alsa-devel mailing list