From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753507AbbKYMgn (ORCPT ); Wed, 25 Nov 2015 07:36:43 -0500 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:48162 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751428AbbKYMgm (ORCPT ); Wed, 25 Nov 2015 07:36:42 -0500 Date: Wed, 25 Nov 2015 12:36:36 +0000 From: Mark Brown To: Sudip Mukherjee Cc: Liam Girdwood , Jaroslav Kysela , Takashi Iwai , linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org Message-ID: <20151125123636.GR1929@sirena.org.uk> References: <1448363546-31193-1-git-send-email-sudipm.mukherjee@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="CPn8Wy5ME997YUMW" Content-Disposition: inline In-Reply-To: <1448363546-31193-1-git-send-email-sudipm.mukherjee@gmail.com> X-Cookie: A beer delayed is a beer denied. User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: 94.175.94.161 X-SA-Exim-Mail-From: broonie@sirena.org.uk Subject: Re: [PATCH] ASoC: hdac_hdmi: remove always false condition X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on mezzanine.sirena.org.uk) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --CPn8Wy5ME997YUMW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Nov 24, 2015 at 04:42:26PM +0530, Sudip Mukherjee wrote: > hdac->num_nodes is unsigned int and can never be less than 0. > 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. Yes, that's a better fix: > hdac->num_nodes = snd_hdac_get_sub_nodes(hdac, hdac->afg, &nid); > - if (!nid || hdac->num_nodes < 0) { > + if (!nid) { it's clear that we're looking for an error code on failure here. --CPn8Wy5ME997YUMW Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJWVatTAAoJECTWi3JdVIfQ1kAH/ietoyJ4K2TDlDJiJ96t89xl ePabvOBQEi8v2o5v0ff4JEWMOm9jUobsBtuiFv8KTOhUEmzjUvmxajuUBKLs/rAn LJJpLicl4vccfw1bpL/f0GGZu/mWO+/IAHRe8pmno42a5c5mY4G81RrwcPYco+N7 0J4FXcpj2ri0gkhlltY++GwVDH7f+YRbodPBkIypdrvgZ3ZURyI/jod96aVSb8f3 cb3awuII93l0gvPy3lYAo4Q9MuQ620Vtfc8uKb1jWIrMTNooY7+ioY5pb2lKZ2oz vdrK/zoyrc0EyAPZzoOgZYJi/FNeNLxqIxHKn41WeNn+qbwxVuZ4AtFugMLwXtE= =ocqZ -----END PGP SIGNATURE----- --CPn8Wy5ME997YUMW--