Skip to content

Commit a753af3

Browse files
agnerstiwai
authored andcommitted
ALSA: ctxfi: use enum type CT_SUM_CTL where appropriate
Currently a variable of type enum CT_AMIXER_CTL is used for enum CT_SUM_CTL values. This leads to warnings when using clang: sound/pci/ctxfi/ctmixer.c:945:32: warning: implicit conversion from enumeration type 'enum CT_SUM_CTL' to different enumeration type 'enum CT_AMIXER_CTL' [-Wenum-conversion] for (i = AMIXER_MASTER_F, j = SUM_IN_F; ~ ^~~~~~~~ sound/pci/ctxfi/ctmixer.c:975:29: warning: implicit conversion from enumeration type 'enum CT_SUM_CTL' to different enumeration type 'enum CT_AMIXER_CTL' [-Wenum-conversion] for (i = AMIXER_PCM_F, j = SUM_IN_F; i <= AMIXER_PCM_S; i++, j++) { ~ ^~~~~~~~ Introduce enum CT_SUM_CTL k and it instead. Signed-off-by: Stefan Agner <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
1 parent 0165519 commit a753af3

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

sound/pci/ctxfi/ctmixer.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -938,17 +938,18 @@ static int ct_mixer_topology_build(struct ct_mixer *mixer)
938938
struct sum *sum;
939939
struct amixer *amix_d, *amix_s;
940940
enum CT_AMIXER_CTL i, j;
941+
enum CT_SUM_CTL k;
941942

942943
/* Build topology from destination to source */
943944

944945
/* Set up Master mixer */
945-
for (i = AMIXER_MASTER_F, j = SUM_IN_F;
946-
i <= AMIXER_MASTER_S; i++, j++) {
946+
for (i = AMIXER_MASTER_F, k = SUM_IN_F;
947+
i <= AMIXER_MASTER_S; i++, k++) {
947948
amix_d = mixer->amixers[i*CHN_NUM];
948-
sum = mixer->sums[j*CHN_NUM];
949+
sum = mixer->sums[k*CHN_NUM];
949950
amix_d->ops->setup(amix_d, &sum->rsc, INIT_VOL, NULL);
950951
amix_d = mixer->amixers[i*CHN_NUM+1];
951-
sum = mixer->sums[j*CHN_NUM+1];
952+
sum = mixer->sums[k*CHN_NUM+1];
952953
amix_d->ops->setup(amix_d, &sum->rsc, INIT_VOL, NULL);
953954
}
954955

@@ -972,12 +973,12 @@ static int ct_mixer_topology_build(struct ct_mixer *mixer)
972973
amix_d->ops->setup(amix_d, &amix_s->rsc, INIT_VOL, NULL);
973974

974975
/* Set up PCM-in mixer */
975-
for (i = AMIXER_PCM_F, j = SUM_IN_F; i <= AMIXER_PCM_S; i++, j++) {
976+
for (i = AMIXER_PCM_F, k = SUM_IN_F; i <= AMIXER_PCM_S; i++, k++) {
976977
amix_d = mixer->amixers[i*CHN_NUM];
977-
sum = mixer->sums[j*CHN_NUM];
978+
sum = mixer->sums[k*CHN_NUM];
978979
amix_d->ops->setup(amix_d, NULL, INIT_VOL, sum);
979980
amix_d = mixer->amixers[i*CHN_NUM+1];
980-
sum = mixer->sums[j*CHN_NUM+1];
981+
sum = mixer->sums[k*CHN_NUM+1];
981982
amix_d->ops->setup(amix_d, NULL, INIT_VOL, sum);
982983
}
983984

0 commit comments

Comments
 (0)