Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: subhransu.s.prusty@intel.com
Cc: alsa-devel@alsa-project.org
Subject: Re: ASoC: hdac-hdmi: Add hdmi driver
Date: Thu, 26 Nov 2015 14:40:48 +0300	[thread overview]
Message-ID: <20151126114048.GA10556@mwanda> (raw)

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

                 reply	other threads:[~2015-11-26 11:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151126114048.GA10556@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=subhransu.s.prusty@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox