Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2897674imm; Sun, 17 Jun 2018 06:48:26 -0700 (PDT) X-Google-Smtp-Source: ADUXVKImJmbYRdFCOhZYlYRYfAdj2ot142ywdhJizVH+d3AHeieCEmXJMcs49ig0+zDWljSD1/GI X-Received: by 2002:a17:902:c85:: with SMTP id 5-v6mr10235435plt.126.1529243306577; Sun, 17 Jun 2018 06:48:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529243306; cv=none; d=google.com; s=arc-20160816; b=iLyTO/8TuXjuviScJKK8xIYXMTBu9OtTUGnhmx5xtCCn4I2lfUYyLPCgPhKyhahJ7D R60QZRcEvgYvTPsrn+eVmCn3mP98poUrKeQne2EKAuYrVJfr9mahSi56VYhdcwGGdW6/ KyDEliBetc0KgtyiYwdmTLzf6+OfzGI6rLeJxOcDywpT//jHL/hRiLz590F/JZzGFWQ3 G57Z9gtv7aBIAgnUU7poTgaTkrr9Ipw7oy4c9ST5hpLYI40V/fPN5JufweOlsApSKZ23 VdVJ1r9M7g76bLV5yevSIwYn5Q7s9TvrkliGnqOeisaKaxItiNQ1rFWoBgsjoLoN21kg mKTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=eBgYbAvAeUgat/9LmSLthWg8/GnXlU5LdZIgVoc1QGY=; b=PgLKms8GJzbZj5UAsLllMw8jJXMBjFy0RCseI8ON1CGJXkS0/s+fPHA7kOnF0Vqgk/ dsS0nlW+MU9pIJQeEiHkLHmU37jcI69kuYEWQaa8Rvlaxcb0+UdbY1/H+9PCWtaMMtJB Aa/Q5ea3g82eG9UoXXb8EGCgdbDvZj3UK81Aneyhz1CsbnvuLJ+EooBj/WUPj+mYXZ0N aQZ5L2qtsL1JFIyKxJmSP0kIpwkNAMgvR8fa25aUHUDZkV+aJwt/hpVW+AyIpvy/uxRL GTmALakur/a9PlSCR7dMbI9Okwgwa9LejA6+Q65a+Aza6V3eAAOYth5pjIaIfcAge6Qw 2Viw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b=q2evcvPp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c12-v6si10236521pgu.26.2018.06.17.06.48.12; Sun, 17 Jun 2018 06:48:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b=q2evcvPp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755541AbeFQNrg (ORCPT + 99 others); Sun, 17 Jun 2018 09:47:36 -0400 Received: from mail.kmu-office.ch ([178.209.48.109]:47068 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754357AbeFQNre (ORCPT ); Sun, 17 Jun 2018 09:47:34 -0400 Received: from trochilidae.lan (unknown [37.17.239.3]) by mail.kmu-office.ch (Postfix) with ESMTPSA id 7EA7B5C00F6; Sun, 17 Jun 2018 15:47:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1529243253; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:content-type:content-transfer-encoding: in-reply-to:references; bh=eBgYbAvAeUgat/9LmSLthWg8/GnXlU5LdZIgVoc1QGY=; b=q2evcvPpSZEQtQoUg5AFuM6pb4M30DIQvq/ycZ655ExkSHlPrgoO5XTXxTXQjHwJrHAdgw 23+1rIqFD63qjIHrYtyzSDraUX6MnezO9P0CA1OxB1xxkQz0WRNjBEnkqMvSp/cv7+np2s VfEQVV9xLoLzNgW/Y2ubWfdFlJsM1cg= From: Stefan Agner To: Jaroslav Kysela , Takashi Iwai Cc: Stefan Agner , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH] ALSA: ctxfi: use enum type CT_SUM_CTL where appropriate Date: Sun, 17 Jun 2018 15:46:49 +0200 Message-Id: <20180617134652.1638-1-stefan@agner.ch> X-Mailer: git-send-email 2.17.1 X-Spamd-Result: default: False [-2.10 / 15.00]; TO_MATCH_ENVRCPT_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%]; RCPT_COUNT_FIVE(0.00)[5]; MIME_GOOD(-0.10)[text/plain]; FROM_HAS_DN(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; DKIM_SIGNED(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_COUNT_ZERO(0.00)[0]; MID_CONTAINS_FROM(1.00)[]; ASN(0.00)[asn:13030, ipnet:37.17.238.0/23, country:CH]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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