Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ALSA: firewire-lib/motu: use int type for the value of bitwise OR with enumerator-constant

It brings some inconvenience in practice to use enumerated type for
variable to which bitwise OR with enumerator constant is assigned.

This commit replaces declarations of enumerated type with int type.

Suggested-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20210518084557.102681-3-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by

Takashi Sakamoto and committed by
Takashi Iwai
ffe66bbe 5d6fb80a

+11 -9
+2 -2
sound/firewire/amdtp-am824.c
··· 410 410 * @s: the AMDTP stream to initialize 411 411 * @unit: the target of the stream 412 412 * @dir: the direction of stream 413 - * @flags: the packet transmission method to use 413 + * @flags: the details of the streaming protocol consist of cip_flags enumeration-constants. 414 414 */ 415 415 int amdtp_am824_init(struct amdtp_stream *s, struct fw_unit *unit, 416 - enum amdtp_stream_direction dir, enum cip_flags flags) 416 + enum amdtp_stream_direction dir, unsigned int flags) 417 417 { 418 418 amdtp_stream_process_ctx_payloads_t process_ctx_payloads; 419 419
+1 -1
sound/firewire/amdtp-am824.h
··· 45 45 struct snd_rawmidi_substream *midi); 46 46 47 47 int amdtp_am824_init(struct amdtp_stream *s, struct fw_unit *unit, 48 - enum amdtp_stream_direction dir, enum cip_flags flags); 48 + enum amdtp_stream_direction dir, unsigned int flags); 49 49 #endif
+2 -2
sound/firewire/amdtp-stream.c
··· 71 71 * @s: the AMDTP stream to initialize 72 72 * @unit: the target of the stream 73 73 * @dir: the direction of stream 74 - * @flags: the packet transmission method to use 74 + * @flags: the details of the streaming protocol consist of cip_flags enumeration-constants. 75 75 * @fmt: the value of fmt field in CIP header 76 76 * @process_ctx_payloads: callback handler to process payloads of isoc context 77 77 * @protocol_size: the size to allocate newly for protocol 78 78 */ 79 79 int amdtp_stream_init(struct amdtp_stream *s, struct fw_unit *unit, 80 - enum amdtp_stream_direction dir, enum cip_flags flags, 80 + enum amdtp_stream_direction dir, unsigned int flags, 81 81 unsigned int fmt, 82 82 amdtp_stream_process_ctx_payloads_t process_ctx_payloads, 83 83 unsigned int protocol_size)
+3 -2
sound/firewire/amdtp-stream.h
··· 112 112 struct amdtp_domain; 113 113 struct amdtp_stream { 114 114 struct fw_unit *unit; 115 - enum cip_flags flags; 115 + // The combination of cip_flags enumeration-constants. 116 + unsigned int flags; 116 117 enum amdtp_stream_direction direction; 117 118 struct mutex mutex; 118 119 ··· 185 184 }; 186 185 187 186 int amdtp_stream_init(struct amdtp_stream *s, struct fw_unit *unit, 188 - enum amdtp_stream_direction dir, enum cip_flags flags, 187 + enum amdtp_stream_direction dir, unsigned int flags, 189 188 unsigned int fmt, 190 189 amdtp_stream_process_ctx_payloads_t process_ctx_payloads, 191 190 unsigned int protocol_size);
+1 -1
sound/firewire/digi00x/amdtp-dot.c
··· 396 396 enum amdtp_stream_direction dir) 397 397 { 398 398 amdtp_stream_process_ctx_payloads_t process_ctx_payloads; 399 - enum cip_flags flags; 399 + unsigned int flags; 400 400 401 401 // Use different mode between incoming/outgoing. 402 402 if (dir == AMDTP_IN_STREAM) {
+2 -1
sound/firewire/motu/motu.h
··· 106 106 struct snd_motu_spec { 107 107 const char *const name; 108 108 enum snd_motu_protocol_version protocol_version; 109 - enum snd_motu_spec_flags flags; 109 + // The combination of snd_motu_spec_flags enumeration-constants. 110 + unsigned int flags; 110 111 111 112 unsigned char tx_fixed_pcm_chunks[3]; 112 113 unsigned char rx_fixed_pcm_chunks[3];