public inbox for linux-clk@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: marek.vasut@gmail.com
Cc: linux-clk@vger.kernel.org
Subject: [bug report] clk: vc5: Add support for IDT VersaClock 5P49V5923 and 5P49V5933
Date: Tue, 24 Jan 2017 12:31:34 +0300	[thread overview]
Message-ID: <20170124093133.GA28235@mwanda> (raw)

Hello Marek Vasut,

The patch 3e1aec4e2c41: "clk: vc5: Add support for IDT VersaClock
5P49V5923 and 5P49V5933" from Jan 12, 2017, leads to the following
static checker warning:

	drivers/clk/clk-versaclock5.c:235 vc5_mux_set_parent()
	error: uninitialized symbol 'src'.

drivers/clk/clk-versaclock5.c
   210  static int vc5_mux_set_parent(struct clk_hw *hw, u8 index)
   211  {
   212          struct vc5_driver_data *vc5 =
   213                  container_of(hw, struct vc5_driver_data, clk_mux);
   214          const u8 mask = VC5_PRIM_SRC_SHDN_EN_XTAL | VC5_PRIM_SRC_SHDN_EN_CLKIN;
   215          u8 src;
                   ^^^
   216  
   217          if ((index > 1) || !vc5->clk_mux_ins)
   218                  return -EINVAL;
   219  
   220          if (vc5->clk_mux_ins == (VC5_MUX_IN_CLKIN | VC5_MUX_IN_XIN)) {
   221                  if (index == 0)
   222                          src = VC5_PRIM_SRC_SHDN_EN_XTAL;
   223                  if (index == 1)
   224                          src = VC5_PRIM_SRC_SHDN_EN_CLKIN;
   225          } else {
   226                  if (index != 0)
   227                          return -EINVAL;
   228  
   229                  if (vc5->clk_mux_ins == VC5_MUX_IN_XIN)
   230                          src = VC5_PRIM_SRC_SHDN_EN_XTAL;
   231                  if (vc5->clk_mux_ins == VC5_MUX_IN_CLKIN)
   232                          src = VC5_PRIM_SRC_SHDN_EN_CLKIN;

What about if both of these are false?

   233          }
   234  
   235          return regmap_update_bits(vc5->regmap, VC5_PRIM_SRC_SHDN, mask, src);
                                                                                ^^^
Potentially uninitialized.

   236  }

regards,
dan carpenter

             reply	other threads:[~2017-01-24  9:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-24  9:31 Dan Carpenter [this message]
2017-01-24 11:21 ` [bug report] clk: vc5: Add support for IDT VersaClock 5P49V5923 and 5P49V5933 Geert Uytterhoeven
2017-01-24 12:50   ` Dan Carpenter

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=20170124093133.GA28235@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=linux-clk@vger.kernel.org \
    --cc=marek.vasut@gmail.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