From patchwork Sun May 6 15:47:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 10382867 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 87C2A60236 for ; Sun, 6 May 2018 15:48:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 773A32787C for ; Sun, 6 May 2018 15:48:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6BE7B28738; Sun, 6 May 2018 15:48:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A87022787C for ; Sun, 6 May 2018 15:48:08 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 59C8926761D; Sun, 6 May 2018 17:47:59 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 7F33126734F; Sun, 6 May 2018 17:47:56 +0200 (CEST) Received: from mail-qt0-f196.google.com (mail-qt0-f196.google.com [209.85.216.196]) by alsa0.perex.cz (Postfix) with ESMTP id 6D719267338 for ; Sun, 6 May 2018 17:47:52 +0200 (CEST) Received: by mail-qt0-f196.google.com with SMTP id h2-v6so33324611qtp.7 for ; Sun, 06 May 2018 08:47:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=5XZO8l1FehJkrgmInINyPYJnn8GXHluI1Gc1Wl5xjFs=; b=ZBzvuNVAsxVS5m1CDbCibx0S7Dfg1ou+YBqRpNXRfpJY7jLYgRy7+DoIIQJx7h301n CfDzyh0CxGvviUwUJuOzX2qtU7dxY4nRXlUEEBJvHjyZvTVx3MkjOlxeSrkknPd+3EHK FvXE4wgxOIRdgBwe6UlXn/gEIJF0Inw3SPSkzy9gzgLR62E3YeQa25oZzPnwBhG0fD5w wPEdj5tdpwcOa2n7s7E0If1w1jhQ4an5AQ6y/Dga2GAmGsb9k6jzDRr5Y4DSsileVYai ErWT7e5xKNHwIDrAvaDMxfpjNq8p2DOmt2B+kFAhB52TMBEzWR/RmH8wE5OWXUgkxY84 syVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=5XZO8l1FehJkrgmInINyPYJnn8GXHluI1Gc1Wl5xjFs=; b=O4Wbz8irby8o0wqOO3XeKL0QUpnUNnX+Lx7pY1kIpwL81q3kaJRuVq3FI8nYe/0LXh i8NzlM7w2WfLgIyRLxVma8peUMSkL2jfWH9mgai6f1xKNun5f3nPDAFafOWfv6C5g4lP vzwfD0BZzWlc8iXVrdj7nVDO747tOncSBWkkjNM67gFNI8DRqhPK1MV8rXXKTKk4KVVb CEJt7ywdk5FH56d5Hksba4wjVjfUZoeTQGvlYkNzT8pcnbDwqkd8xU0CZ8y8iAo458De JEu20fHbkoVa9AhvU8y2VynBROU4Kz7Z37M9y0DOmzaO6ZzvtZkfCQEgqKFHolnIAt7n bVCQ== X-Gm-Message-State: ALQs6tBbtV9OZlZ0zIUfvNga+Z7VPN6TDlVNm2g5voGak0ZZEIIfBL2f i790tDbm0jFctk0IwzNMMk8= X-Google-Smtp-Source: AB8JxZoh/jidcShs1l/dv2N63s1C4sgfQgGeamv3TEFdMmhkRzvsvZ8U0/4YdwloecVwYwl45/6bYw== X-Received: by 2002:ac8:f71:: with SMTP id l46-v6mr30282036qtk.45.1525621672197; Sun, 06 May 2018 08:47:52 -0700 (PDT) Received: from localhost.localdomain ([2804:14d:90ae:4c9c:cde4:b11c:33c2:be38]) by smtp.gmail.com with ESMTPSA id 135sm16180309qkf.26.2018.05.06.08.47.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 06 May 2018 08:47:51 -0700 (PDT) From: Fabio Estevam To: broonie@kernel.org Date: Sun, 6 May 2018 12:47:44 -0300 Message-Id: <1525621665-11022-2-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1525621665-11022-1-git-send-email-festevam@gmail.com> References: <1525621665-11022-1-git-send-email-festevam@gmail.com> Cc: Fabio Estevam , alsa-devel@alsa-project.org Subject: [alsa-devel] [PATCH 2/3] ASoC: davinci-mcasp: Use 'snd_pcm_format_t' type X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Fabio Estevam 'snd_pcm_format_t' type is better suited for iterating through the SNDRV_PCM_FORMAT members. Also, use SNDRV_PCM_FORMAT_FIRST for the first element. Signed-off-by: Fabio Estevam --- sound/soc/davinci/davinci-mcasp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c index 03ba218..bde2252 100644 --- a/sound/soc/davinci/davinci-mcasp.c +++ b/sound/soc/davinci/davinci-mcasp.c @@ -1214,11 +1214,12 @@ static int davinci_mcasp_hw_rule_format(struct snd_pcm_hw_params *params, struct snd_mask nfmt; int rate = params_rate(params); int slots = rd->mcasp->tdm_slots; - int i, count = 0; + snd_pcm_format_t i; + int count = 0; snd_mask_none(&nfmt); - for (i = 0; i <= SNDRV_PCM_FORMAT_LAST; i++) { + for (i = SNDRV_PCM_FORMAT_FIRST; i <= SNDRV_PCM_FORMAT_LAST; i++) { if (snd_mask_test(fmt, i)) { uint sbits = snd_pcm_format_width(i); int ppm;