From patchwork Fri Dec 12 19:28:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 5485141 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 D2E2B9F1CD for ; Fri, 12 Dec 2014 19:28:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1416320172 for ; Fri, 12 Dec 2014 19:28:28 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id B77FB201EF for ; Fri, 12 Dec 2014 19:28:26 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id C889E2651AF; Fri, 12 Dec 2014 20:28:25 +0100 (CET) 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,NO_DNS_FOR_FROM, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id C9916260713; Fri, 12 Dec 2014 20:28:21 +0100 (CET) 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 864F2260713; Fri, 12 Dec 2014 20:28:20 +0100 (CET) Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by alsa0.perex.cz (Postfix) with ESMTP id ED9BD261489 for ; Fri, 12 Dec 2014 20:28:10 +0100 (CET) Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id sBCJS8LN031726 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 12 Dec 2014 19:28:09 GMT Received: from userz7021.oracle.com (userz7021.oracle.com [156.151.31.85]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id sBCJS7gG002443 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Fri, 12 Dec 2014 19:28:08 GMT Received: from abhmp0020.oracle.com (abhmp0020.oracle.com [141.146.116.26]) by userz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id sBCJS6kQ027720; Fri, 12 Dec 2014 19:28:06 GMT Received: from mwanda (/154.0.139.178) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 12 Dec 2014 11:28:06 -0800 Date: Fri, 12 Dec 2014 22:28:10 +0300 From: Dan Carpenter To: Clemens Ladisch Message-ID: <20141212192810.GB22234@mwanda> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: acsinet22.oracle.com [141.146.126.238] Cc: alsa-devel@alsa-project.org, Takashi Iwai , kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, Takashi Sakamoto Subject: [alsa-devel] [patch 2/2] ALSA: oxfw: fix detect_loud_models() return value 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 This code causes a static checker warning: sound/firewire/oxfw/oxfw.c:46 detect_loud_models() warn: signedness bug returning '(-2)' The detect_loud_models() function should return false on falure, so that we don't try to set up the loud code for hardware that doesn't support it. Signed-off-by: Dan Carpenter diff --git a/sound/firewire/oxfw/oxfw.c b/sound/firewire/oxfw/oxfw.c index cf1d0b5..60e5cad 100644 --- a/sound/firewire/oxfw/oxfw.c +++ b/sound/firewire/oxfw/oxfw.c @@ -43,7 +43,7 @@ static bool detect_loud_models(struct fw_unit *unit) err = fw_csr_string(unit->directory, CSR_MODEL, model, sizeof(model)); if (err < 0) - return err; + return false; for (i = 0; i < ARRAY_SIZE(models); i++) { if (strcmp(models[i], model) == 0)