From patchwork Sat May 31 06:33:52 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 4274981 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2E4F99F1D6 for ; Sat, 31 May 2014 06:34:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 64DDB203A0 for ; Sat, 31 May 2014 06:34:24 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id D2B5320397 for ; Sat, 31 May 2014 06:34:22 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 3D01F26535E; Sat, 31 May 2014 08:34:21 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 021622651F0; Sat, 31 May 2014 08:34:11 +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 04110265328; Sat, 31 May 2014 08:34:08 +0200 (CEST) Received: from smtp311.phy.lolipop.jp (smtp311.phy.lolipop.jp [210.157.22.79]) by alsa0.perex.cz (Postfix) with ESMTP id 9BE2E2650C2 for ; Sat, 31 May 2014 08:33:59 +0200 (CEST) Received: from smtp311.phy.lolipop.lan (HELO smtp311.phy.lolipop.jp) (172.17.1.11) (smtp-auth username m12129643-o-takashi, mechanism plain) by smtp311.phy.lolipop.jp (qpsmtpd/0.82) with ESMTPA; Sat, 31 May 2014 15:33:57 +0900 Received: from 127.0.0.1 (127.0.0.1) by smtp311.phy.lolipop.jp (LOLIPOP-Fsecure); Sat, 31 May 2014 15:33:53 +0900 (JST) X-Virus-Status: clean(LOLIPOP-Fsecure) From: Takashi Sakamoto To: clemens@ladisch.de, tiwai@suse.de, perex@perex.cz Date: Sat, 31 May 2014 15:33:52 +0900 Message-Id: <1401518032-7223-1-git-send-email-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 1.8.3.2 Cc: alsa-devel@alsa-project.org Subject: [alsa-devel] [PATCH] bebob: Use ARRAY_SIZE() instead of sizeof() for return condition 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 The parser for stream format information should return when detecting wrong value for sampling rate. But it doesn't. Signed-off-by: Takashi Sakamoto --- sound/firewire/bebob/bebob_stream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/firewire/bebob/bebob_stream.c b/sound/firewire/bebob/bebob_stream.c index 514c7c9..bc4f827 100644 --- a/sound/firewire/bebob/bebob_stream.c +++ b/sound/firewire/bebob/bebob_stream.c @@ -749,7 +749,7 @@ parse_stream_formation(u8 *buf, unsigned int len, if (buf[2] == bridgeco_freq_table[i]) break; } - if (i == sizeof(bridgeco_freq_table)) + if (i == ARRAY_SIZE(bridgeco_freq_table)) return -ENOSYS; /* Avoid double count by different entries for the same rate. */