ALSA: firewire-lib/motu: use int type for the value of bitwise OR with enumerator...
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Tue, 18 May 2021 08:45:48 +0000 (17:45 +0900)
committerTakashi Iwai <tiwai@suse.de>
Tue, 18 May 2021 10:21:52 +0000 (12:21 +0200)
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>
sound/firewire/amdtp-am824.c
sound/firewire/amdtp-am824.h
sound/firewire/amdtp-stream.c
sound/firewire/amdtp-stream.h
sound/firewire/digi00x/amdtp-dot.c
sound/firewire/motu/motu.h

index fea92e148790f28fb6cdb33e0b0aee55665e3ced..d9c700f652bbb8c12042062e9ce8f43bdcf7e758 100644 (file)
@@ -410,10 +410,10 @@ static unsigned int process_ir_ctx_payloads(struct amdtp_stream *s,
  * @s: the AMDTP stream to initialize
  * @unit: the target of the stream
  * @dir: the direction of stream
- * @flags: the packet transmission method to use
+ * @flags: the details of the streaming protocol consist of cip_flags enumeration-constants.
  */
 int amdtp_am824_init(struct amdtp_stream *s, struct fw_unit *unit,
-                    enum amdtp_stream_direction dir, enum cip_flags flags)
+                    enum amdtp_stream_direction dir, unsigned int flags)
 {
        amdtp_stream_process_ctx_payloads_t process_ctx_payloads;
 
index 06d2807835818e90238c31a09d947dcd8ff988c1..2b092b1061bafbb8c4f1a637fe10fbce490bf763 100644 (file)
@@ -45,5 +45,5 @@ void amdtp_am824_midi_trigger(struct amdtp_stream *s, unsigned int port,
                              struct snd_rawmidi_substream *midi);
 
 int amdtp_am824_init(struct amdtp_stream *s, struct fw_unit *unit,
-                    enum amdtp_stream_direction dir, enum cip_flags flags);
+                    enum amdtp_stream_direction dir, unsigned int flags);
 #endif
index e0faa6601966cae2a53e82e80b4a768d79997192..b14c3922efb21b943c631904efedbd4abba369ae 100644 (file)
@@ -71,13 +71,13 @@ static void pcm_period_work(struct work_struct *work);
  * @s: the AMDTP stream to initialize
  * @unit: the target of the stream
  * @dir: the direction of stream
- * @flags: the packet transmission method to use
+ * @flags: the details of the streaming protocol consist of cip_flags enumeration-constants.
  * @fmt: the value of fmt field in CIP header
  * @process_ctx_payloads: callback handler to process payloads of isoc context
  * @protocol_size: the size to allocate newly for protocol
  */
 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, unsigned int flags,
                      unsigned int fmt,
                      amdtp_stream_process_ctx_payloads_t process_ctx_payloads,
                      unsigned int protocol_size)
index a3daa1f2c1c437a644e81da4a2eb802a63bc6b87..0628b6e52fc13a28ab8d38b1b1c2167aba87702e 100644 (file)
@@ -112,7 +112,8 @@ typedef unsigned int (*amdtp_stream_process_ctx_payloads_t)(
 struct amdtp_domain;
 struct amdtp_stream {
        struct fw_unit *unit;
-       enum cip_flags flags;
+       // The combination of cip_flags enumeration-constants.
+       unsigned int flags;
        enum amdtp_stream_direction direction;
        struct mutex mutex;
 
@@ -184,7 +185,7 @@ struct amdtp_stream {
 };
 
 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, unsigned int flags,
                      unsigned int fmt,
                      amdtp_stream_process_ctx_payloads_t process_ctx_payloads,
                      unsigned int protocol_size);
index d613642a2ce352f8ef741c45fa4dcb98e0418ed8..398c57a6fb43724c10e0762954c52a3c8d90bfcf 100644 (file)
@@ -396,7 +396,7 @@ int amdtp_dot_init(struct amdtp_stream *s, struct fw_unit *unit,
                 enum amdtp_stream_direction dir)
 {
        amdtp_stream_process_ctx_payloads_t process_ctx_payloads;
-       enum cip_flags flags;
+       unsigned int flags;
 
        // Use different mode between incoming/outgoing.
        if (dir == AMDTP_IN_STREAM) {
index 3d0236ee67167f59e98380b1baf1c4dd2bebd0b5..92effb6e6c96f56a0acc7b8cb31e8da0aa9112ef 100644 (file)
@@ -106,7 +106,8 @@ enum snd_motu_protocol_version {
 struct snd_motu_spec {
        const char *const name;
        enum snd_motu_protocol_version protocol_version;
-       enum snd_motu_spec_flags flags;
+       // The combination of snd_motu_spec_flags enumeration-constants.
+       unsigned int flags;
 
        unsigned char tx_fixed_pcm_chunks[3];
        unsigned char rx_fixed_pcm_chunks[3];