All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: ramesh.babu@intel.com
Cc: alsa-devel@alsa-project.org
Subject: Re: ASoC: core: Call mute for cpu dais as well
Date: Thu, 27 Nov 2014 19:15:03 +0300	[thread overview]
Message-ID: <20141127161503.GA21893@mwanda> (raw)

Hello Ramesh Babu,

This is a semi-automatic email about new static checker warnings.

The patch ae11601b80b9: "ASoC: core: Call mute for cpu dais as well" 
from Oct 15, 2014, leads to the following Smatch complaint:

sound/soc/soc-pcm.c:777 soc_pcm_prepare()
	 error: we previously assumed 'cpu_dai->driver->ops' could be null (see line 755)

sound/soc/soc-pcm.c
   754	
   755		if (cpu_dai->driver->ops && cpu_dai->driver->ops->prepare) {
                    ^^^^^^^^^^^^^^^^^^^^
I don't think this can be NULL.  Probably we should remove this check.

   756			ret = cpu_dai->driver->ops->prepare(substream, cpu_dai);
   757			if (ret < 0) {
   758				dev_err(cpu_dai->dev, "ASoC: DAI prepare error: %d\n",
   759					ret);
   760				goto out;
   761			}
   762		}
   763	
   764		/* cancel any delayed stream shutdown that is pending */
   765		if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK &&
   766		    rtd->pop_wait) {
   767			rtd->pop_wait = 0;
   768			cancel_delayed_work(&rtd->delayed_work);
   769		}
   770	
   771		snd_soc_dapm_stream_event(rtd, substream->stream,
   772				SND_SOC_DAPM_STREAM_START);
   773	
   774		for (i = 0; i < rtd->num_codecs; i++)
   775			snd_soc_dai_digital_mute(rtd->codec_dais[i], 0,
   776						 substream->stream);
   777		snd_soc_dai_digital_mute(cpu_dai, 0, substream->stream);
                                         ^^^^^^^
But if it were NULL then this newly introduced function call would Oops.

   778	
   779	out:

regards,
dan carpenter

             reply	other threads:[~2014-11-27 16:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-27 16:15 Dan Carpenter [this message]
2014-12-02 17:13 ` ASoC: core: Call mute for cpu dais as well Babu, Ramesh
2014-12-02 19:26   ` Lars-Peter Clausen

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=20141127161503.GA21893@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=ramesh.babu@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.