Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1276335 > unrolled thread
| Started by | Sudip Mukherjee <sudipm.mukherjee@gmail.com> |
|---|---|
| First post | 2015-11-24 12:20 +0100 |
| Last post | 2015-11-25 13:40 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[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
| From | Sudip Mukherjee <sudipm.mukherjee@gmail.com> |
|---|---|
| Date | 2015-11-24 12:20 +0100 |
| Subject | [PATCH] ASoC: hdac_hdmi: remove always false condition |
| Message-ID | <qyjND-7oT-5@gated-at.bofh.it> |
hdac->num_nodes is unsigned int and can never be less than 0.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
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;
}
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Mark Brown <broonie@kernel.org> |
|---|---|
| Date | 2015-11-25 13:40 +0100 |
| Message-ID | <qyHwD-6ho-41@gated-at.bofh.it> |
| In reply to | #1276335 |
[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.
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web