From patchwork Thu Sep 1 06:52:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 9308371 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 B892360756 for ; Thu, 1 Sep 2016 06:54:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A3201291E6 for ; Thu, 1 Sep 2016 06:54:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 97C1B291E9; Thu, 1 Sep 2016 06:54:04 +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=-6.9 required=2.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5726A291E6 for ; Thu, 1 Sep 2016 06:54:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752661AbcIAGxq (ORCPT ); Thu, 1 Sep 2016 02:53:46 -0400 Received: from smtp11.smtpout.orange.fr ([80.12.242.133]:36053 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752512AbcIAGxp (ORCPT ); Thu, 1 Sep 2016 02:53:45 -0400 Received: from localhost.localdomain ([92.140.166.52]) by mwinf5d22 with ME id e6si1t00E189VV0036siGx; Thu, 01 Sep 2016 08:52:46 +0200 X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Thu, 01 Sep 2016 08:52:46 +0200 X-ME-IP: 92.140.166.52 From: Christophe JAILLET To: peter.ujfalusi@ti.com, jarkko.nikula@bitmer.com, lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com Cc: alsa-devel@alsa-project.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH] ASoC: omap-pcm: off-by-one in 'omap_pcm_limit_supported_formats' Date: Thu, 1 Sep 2016 08:52:37 +0200 Message-Id: <1472712757-21066-1-git-send-email-christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.7.4 X-Antivirus: avast! (VPS 160831-3, 31/08/2016), Outbound message X-Antivirus-Status: Clean Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When calling 'snd_pcm_format_physical_width', SNDRV_PCM_FORMAT_LAST is a valid value, so don't skip it. Signed-off-by: Christophe JAILLET Acked-by: Peter Ujfalusi --- Un-tested --- sound/soc/omap/omap-pcm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/omap/omap-pcm.c b/sound/soc/omap/omap-pcm.c index a84f677234f0..94e9ff791f3a 100644 --- a/sound/soc/omap/omap-pcm.c +++ b/sound/soc/omap/omap-pcm.c @@ -58,7 +58,7 @@ static void omap_pcm_limit_supported_formats(void) { int i; - for (i = 0; i < SNDRV_PCM_FORMAT_LAST; i++) { + for (i = 0; i <= SNDRV_PCM_FORMAT_LAST; i++) { switch (snd_pcm_format_physical_width(i)) { case 8: case 16: