Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1277347

Re: [PATCH] ASoC: hdac_hdmi: remove always false condition

From Mark Brown <broonie@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH] ASoC: hdac_hdmi: remove always false condition
Date 2015-11-25 13:40 +0100
Message-ID <qyHwD-6ho-41@gated-at.bofh.it> (permalink)
References <qyjND-7oT-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

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.

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

[PATCH] ASoC: hdac_hdmi: remove always false condition Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-11-24 12:20 +0100
  Re: [PATCH] ASoC: hdac_hdmi: remove always false condition Mark Brown <broonie@kernel.org> - 2015-11-25 13:40 +0100

csiph-web