[alsa-devel] [PATCH 3/3] ALSA: firewire-lib: change structure member with proper type

Takashi Sakamoto o-takashi at sakamocchi.jp
Thu Jan 5 01:10:50 CET 2017


Hi Clemens,

On Jan 4 2017 20:13, Clemens Ladisch wrote:
> Takashi Sakamoto wrote:
>> The 'amdtp_stream' structure is initialized by a call of
>> 'amdtp_stream_init()'. Although a parameter of this function is for bit
>> flags of packet attributes, its type is enumerator.
>
> This is the correct type to use for an enumeration consisting of bit
> flags.  What problem do you see with this?

We have cases that an actual value to the parameter is not one of 
enumeration-constants. I had this concern and posted the patch.

But this is permitted, as you said. C language specification has loose 
constrains to the actual value of the type, just within a range of 
enumeration-constants. I understand that a list of enumeration-constants 
is just used to decide the actual integer type of the type.

I'll post revert patch. Thanks for your indication!

>>  int amdtp_stream_init(struct amdtp_stream *s, struct fw_unit *unit,
>> -		      enum amdtp_stream_direction dir, enum cip_flags flags,
>> +		      enum amdtp_stream_direction dir, int flags,
>>  		      unsigned int fmt,


Regards

Takashi Sakamoto


More information about the Alsa-devel mailing list