From patchwork Wed May 28 16:43:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 4256491 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 EAB3A9F336 for ; Wed, 28 May 2014 16:44:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 04269202BE for ; Wed, 28 May 2014 16:44:52 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id E5D7820170 for ; Wed, 28 May 2014 16:44:50 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id BD5442650BC; Wed, 28 May 2014 18:44:49 +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 DDE1A2651E6; Wed, 28 May 2014 18:44:24 +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 745922651E6; Wed, 28 May 2014 18:44:23 +0200 (CEST) Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by alsa0.perex.cz (Postfix) with ESMTP id C4216265654 for ; Wed, 28 May 2014 18:43:50 +0200 (CEST) Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s4SGhlj0010865 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 28 May 2014 16:43:48 GMT Received: from userz7021.oracle.com (userz7021.oracle.com [156.151.31.85]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s4SGhkUX005561 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Wed, 28 May 2014 16:43:47 GMT Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by userz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s4SGhkf3005537; Wed, 28 May 2014 16:43:46 GMT Received: from mwanda (/41.202.240.7) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 28 May 2014 09:43:45 -0700 Date: Wed, 28 May 2014 19:43:30 +0300 From: Dan Carpenter To: Clemens Ladisch Message-ID: <20140528164330.GD1824@mwanda> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: ucsinet21.oracle.com [156.151.31.93] Cc: Takashi Iwai , alsa-devel@alsa-project.org, Takashi Sakamoto , kernel-janitors@vger.kernel.org Subject: [alsa-devel] [patch] ALSA: bebob: sizeof() vs ARRAY_SIZE() typo 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP ARRAY_SIZE() was intended here instead of sizeof(). The "bridgeco_freq_table" array holds integers so the original condition is never true. Signed-off-by: Dan Carpenter Tested-by: Takashi Sakamoto 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. */