* [PATCH] ALSA: ctxfi: use enum type CT_SUM_CTL where appropriate
@ 2018-06-17 13:46 Stefan Agner
2018-06-18 15:40 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: Stefan Agner @ 2018-06-17 13:46 UTC (permalink / raw)
To: Jaroslav Kysela, Takashi Iwai; +Cc: Stefan Agner, alsa-devel, linux-kernel
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 <stefan@agner.ch>
---
sound/pci/ctxfi/ctmixer.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/sound/pci/ctxfi/ctmixer.c b/sound/pci/ctxfi/ctmixer.c
index db710d0a609f..4777d50fbbf8 100644
--- a/sound/pci/ctxfi/ctmixer.c
+++ b/sound/pci/ctxfi/ctmixer.c
@@ -938,17 +938,18 @@ static int ct_mixer_topology_build(struct ct_mixer *mixer)
struct sum *sum;
struct amixer *amix_d, *amix_s;
enum CT_AMIXER_CTL i, j;
+ enum CT_SUM_CTL k;
/* Build topology from destination to source */
/* Set up Master mixer */
- for (i = AMIXER_MASTER_F, j = SUM_IN_F;
- i <= AMIXER_MASTER_S; i++, j++) {
+ for (i = AMIXER_MASTER_F, k = SUM_IN_F;
+ i <= AMIXER_MASTER_S; i++, k++) {
amix_d = mixer->amixers[i*CHN_NUM];
- sum = mixer->sums[j*CHN_NUM];
+ sum = mixer->sums[k*CHN_NUM];
amix_d->ops->setup(amix_d, &sum->rsc, INIT_VOL, NULL);
amix_d = mixer->amixers[i*CHN_NUM+1];
- sum = mixer->sums[j*CHN_NUM+1];
+ sum = mixer->sums[k*CHN_NUM+1];
amix_d->ops->setup(amix_d, &sum->rsc, INIT_VOL, NULL);
}
@@ -972,12 +973,12 @@ static int ct_mixer_topology_build(struct ct_mixer *mixer)
amix_d->ops->setup(amix_d, &amix_s->rsc, INIT_VOL, NULL);
/* Set up PCM-in mixer */
- for (i = AMIXER_PCM_F, j = SUM_IN_F; i <= AMIXER_PCM_S; i++, j++) {
+ for (i = AMIXER_PCM_F, k = SUM_IN_F; i <= AMIXER_PCM_S; i++, k++) {
amix_d = mixer->amixers[i*CHN_NUM];
- sum = mixer->sums[j*CHN_NUM];
+ sum = mixer->sums[k*CHN_NUM];
amix_d->ops->setup(amix_d, NULL, INIT_VOL, sum);
amix_d = mixer->amixers[i*CHN_NUM+1];
- sum = mixer->sums[j*CHN_NUM+1];
+ sum = mixer->sums[k*CHN_NUM+1];
amix_d->ops->setup(amix_d, NULL, INIT_VOL, sum);
}
--
2.17.1
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] ALSA: ctxfi: use enum type CT_SUM_CTL where appropriate
2018-06-17 13:46 [PATCH] ALSA: ctxfi: use enum type CT_SUM_CTL where appropriate Stefan Agner
@ 2018-06-18 15:40 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2018-06-18 15:40 UTC (permalink / raw)
To: Stefan Agner; +Cc: Jaroslav Kysela, alsa-devel, linux-kernel
On Sun, 17 Jun 2018 15:46:49 +0200,
Stefan Agner wrote:
>
> 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 <stefan@agner.ch>
Applied, thanks.
Takashi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-06-18 15:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-17 13:46 [PATCH] ALSA: ctxfi: use enum type CT_SUM_CTL where appropriate Stefan Agner
2018-06-18 15:40 ` Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®