From patchwork Tue Nov 24 11:12:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudip Mukherjee X-Patchwork-Id: 7689831 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8FA409F4F5 for ; Tue, 24 Nov 2015 11:12:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ADEB520828 for ; Tue, 24 Nov 2015 11:12:54 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 84EF4207D7 for ; Tue, 24 Nov 2015 11:12:53 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 0ECA5265D7B; Tue, 24 Nov 2015 12:12:52 +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=-2.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, NO_DNS_FOR_FROM, RCVD_IN_DNSWL_LOW, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 9E78D26153F; Tue, 24 Nov 2015 12:12:43 +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 20AFF265A6F; Tue, 24 Nov 2015 12:12:43 +0100 (CET) Received: from mail-pa0-f44.google.com (mail-pa0-f44.google.com [209.85.220.44]) by alsa0.perex.cz (Postfix) with ESMTP id F03022614E2 for ; Tue, 24 Nov 2015 12:12:35 +0100 (CET) Received: by padhx2 with SMTP id hx2so19700550pad.1 for ; Tue, 24 Nov 2015 03:12:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=jPPF0RuhwriMKKEcWSYWaP0hYMExiEE00KocX1yX4Gc=; b=QetF/aoOMiwsOEOh2Y1wcEX78P+sraz8A2HN4qeKz2beG+zv8PRUoB36oad+x4OU0R wYioQblO4RmQEjVgSuq4TVv9GcpH3mGvvJ+n7UqHzsJ3pHxQyyPUvgLbBUkUnduBMjzr OKS1h0duIFECwLk2BYg2vjbQNCUG0gAxOnUygFFfsuzuy4wcbU0/bncqEqL1Tpv2NMBQ f1RUWabiA2csc21NdBMgJ0vF/KWkc52WwMMj9dHhHLymTyNM2bMDr1/z4c97qaYqi6wH 2UtTSPtHb16hrSBjUwfJbC+zY/M1OIB29KMMT7Lk7Cu/xUUjIpepjDsa3eYaXOeb8TXT 2gtA== X-Received: by 10.66.233.73 with SMTP id tu9mr41979421pac.52.1448363554560; Tue, 24 Nov 2015 03:12:34 -0800 (PST) Received: from sudip-pc.vectortproxy.org ([122.169.181.80]) by smtp.gmail.com with ESMTPSA id x79sm13703063pfi.47.2015.11.24.03.12.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 24 Nov 2015 03:12:33 -0800 (PST) From: Sudip Mukherjee To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai Date: Tue, 24 Nov 2015 16:42:26 +0530 Message-Id: <1448363546-31193-1-git-send-email-sudipm.mukherjee@gmail.com> X-Mailer: git-send-email 1.9.1 Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Sudip Mukherjee Subject: [alsa-devel] [PATCH] ASoC: hdac_hdmi: remove always false 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 hdac->num_nodes is unsigned int and can never be less than 0. Signed-off-by: Sudip Mukherjee --- Or, maybe, another way can be to declare num_nodes as int. Then this test makes sense and also snd_hdac_get_sub_nodes() is returning an int. sound/soc/codecs/hdac_hdmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/hdac_hdmi.c b/sound/soc/codecs/hdac_hdmi.c index 205f2c2..02109aa 100644 --- a/sound/soc/codecs/hdac_hdmi.c +++ b/sound/soc/codecs/hdac_hdmi.c @@ -415,7 +415,7 @@ static int hdac_hdmi_parse_and_map_nid(struct hdac_ext_device *edev) int cvt_nid = 0, pin_nid = 0; hdac->num_nodes = snd_hdac_get_sub_nodes(hdac, hdac->afg, &nid); - if (!nid || hdac->num_nodes < 0) { + if (!nid) { dev_warn(&hdac->dev, "HDMI: failed to get afg sub nodes\n"); return -EINVAL; }