Skip to content

Commit 7a7c07b

Browse files
committed
Apply suggestion
1 parent 4d9aefd commit 7a7c07b

File tree

1 file changed

+21
-18
lines changed

1 file changed

+21
-18
lines changed

virtio-snd.c

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -64,31 +64,34 @@ enum {
6464
VIRTIO_SND_S_IO_ERR,
6565
};
6666

67+
/* Unit: Hz */
68+
#define SND_PCM_RATE \
69+
_(5512) \
70+
_(8000) \
71+
_(11025) \
72+
_(16000) \
73+
_(22050) \
74+
_(32000) \
75+
_(44100) \
76+
_(48000) \
77+
_(64000) \
78+
_(88200) \
79+
_(96000) \
80+
_(176400) \
81+
_(192000) \
82+
_(384000)
83+
6784
/* supported PCM frame rates */
6885
enum {
69-
#define _(rate) VIRTIO_SND_PCM_RATE_##rate
70-
_(5512) = 0, /* 5512 Hz */
71-
_(8000), /* 8000 Hz */
72-
_(11025), /* 11025 Hz */
73-
_(16000), /* 16000 Hz */
74-
_(22050), /* 22050 Hz */
75-
_(32000), /* 32000 Hz */
76-
_(44100), /* 44100 Hz */
77-
_(48000), /* 48000 Hz */
78-
_(64000), /* 64000 Hz */
79-
_(88200), /* 88200 Hz */
80-
_(96000), /* 96000 Hz */
81-
_(176400), /* 176400 Hz */
82-
_(192000), /* 192000 Hz */
83-
_(384000), /* 384000 Hz */
86+
#define _(rate) VIRTIO_SND_PCM_RATE_##rate,
87+
SND_PCM_RATE
8488
#undef _
8589
};
8690

8791
/* supported PCM frames rates mapping */
8892
int pcm_rate_tbl[] = {
89-
#define _(rate) [VIRTIO_SND_PCM_RATE_##rate] = rate
90-
_(5512), _(8000), _(11025), _(16000), _(22050), _(32000), _(44100),
91-
_(48000), _(64000), _(88200), _(96000), _(176400), _(192000), _(384000),
93+
#define _(rate) [VIRTIO_SND_PCM_RATE_##rate] = rate,
94+
SND_PCM_RATE
9295
#undef _
9396
};
9497

0 commit comments

Comments
 (0)