All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kuninori.morimoto.gx@renesas.com
Cc: alsa-devel@alsa-project.org
Subject: [bug report] ASoC: rsnd: add null CLOCKIN support
Date: Wed, 9 Jun 2021 14:31:17 +0300	[thread overview]
Message-ID: <YMCmhfQUimHCSH/n@mwanda> (raw)

Hello Kuninori Morimoto,

The patch d6956a7dde6f: "ASoC: rsnd: add null CLOCKIN support" from
May 24, 2021, leads to the following static checker warning:

	sound/soc/sh/rcar/adg.c:435 rsnd_adg_get_clkin()
	warn: 'clk' isn't an ERR_PTR

sound/soc/sh/rcar/adg.c
   423  static int rsnd_adg_get_clkin(struct rsnd_priv *priv)
   424  {
   425          struct rsnd_adg *adg = priv->adg;
   426          struct device *dev = rsnd_priv_to_dev(priv);
   427          struct clk *clk;
   428          int i;
   429  
   430          for (i = 0; i < CLKMAX; i++) {
   431                  clk = devm_clk_get(dev, clk_name[i]);

If devm_clk_get() returns NULL that's not an error.


   432  
   433                  if (IS_ERR(clk))
   434                          clk = rsnd_adg_null_clk_get(priv);

But I think if rsnd_adg_null_clk_get() returns an error then it is an
error.


   435                  if (IS_ERR(clk))

This is impossible.

   436                          goto err;

So I think it should be:

			if (IS_ERR(clk)) {
				clk = rsnd_adg_null_clk_get(priv);
				if (!clk)
					goto err;
			}

   437  
   438                  adg->clk[i] = clk;
   439          }
   440  
   441          return 0;
   442  
   443  err:
   444          dev_err(dev, "adg clock IN get failed\n");
   445  
   446          rsnd_adg_null_clk_clean(priv);
   447  
   448          return -EIO;
   449  }

regards,
dan carpenter

             reply	other threads:[~2021-06-09 11:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-09 11:31 Dan Carpenter [this message]
2021-06-09 23:31 ` [bug report] ASoC: rsnd: add null CLOCKIN support Kuninori Morimoto
2021-06-10  4:24   ` Dan Carpenter
2021-06-10  4:32     ` Kuninori Morimoto

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=YMCmhfQUimHCSH/n@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=kuninori.morimoto.gx@renesas.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.