* Re: ASoC: hdac-hdmi: Add hdmi driver
@ 2015-11-26 11:40 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2015-11-26 11:40 UTC (permalink / raw)
To: subhransu.s.prusty; +Cc: alsa-devel
Hello Subhransu S. Prusty,
The patch 18382ead3640: "ASoC: hdac-hdmi: Add hdmi driver" from Nov
10, 2015, leads to the following static checker warning:
sound/soc/codecs/hdac_hdmi.c:416 hdac_hdmi_parse_and_map_nid()
warn: unsigned 'hdac->num_nodes' is never less than zero.
sound/soc/codecs/hdac_hdmi.c
409 static int hdac_hdmi_parse_and_map_nid(struct hdac_ext_device *edev)
410 {
411 hda_nid_t nid;
412 int i;
413 struct hdac_device *hdac = &edev->hdac;
414 struct hdac_hdmi_priv *hdmi = edev->private_data;
415 int cvt_nid = 0, pin_nid = 0;
416
417 hdac->num_nodes = snd_hdac_get_sub_nodes(hdac, hdac->afg, &nid);
418 if (!nid || hdac->num_nodes < 0) {
^^^^^^^^^^^^^^^^^^^
snd_hdac_get_sub_nodes() never returns negatives. (We can't create a
static checker warning for this because it's impossible to know if the
author is planning to add error returns later). It returns zero if
not found so maybe that was intended intsead?
419 dev_warn(&hdac->dev, "HDMI: failed to get afg sub nodes\n");
420 return -EINVAL;
421 }
regards,
dan carpenter
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-11-26 11:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-26 11:40 ASoC: hdac-hdmi: Add hdmi driver Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox