linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kbuild test robot <fengguang.wu@intel.com>
To: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: kbuild-all@01.org, linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Linux Memory Management List <linux-mm@kvack.org>
Subject: sound/soc/codecs/wm8962.c:2790:32: warning: 'fratio' may be used uninitialized in this function
Date: Mon, 25 Jan 2016 15:15:36 +0800	[thread overview]
Message-ID: <201601251528.rosikkYN%fengguang.wu@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 3250 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   92e963f50fc74041b5e9e744c330dca48e04f08d
commit: c6d308534aef6c99904bf5862066360ae067abc4 UBSAN: run-time undefined behavior sanity checker
date:   4 days ago
config: x86_64-randconfig-n0-01251456 (attached as .config)
reproduce:
        git checkout c6d308534aef6c99904bf5862066360ae067abc4
        # save the attached .config to linux build tree
        make ARCH=x86_64 

Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings

All warnings (new ones prefixed by >>):

   sound/soc/codecs/wm8962.c: In function 'wm8962_set_fll':
>> sound/soc/codecs/wm8962.c:2790:32: warning: 'fratio' may be used uninitialized in this function [-Wmaybe-uninitialized]
     fll_div->n = target / (fratio * Fref);
                                   ^
   sound/soc/codecs/wm8962.c:2740:15: note: 'fratio' was declared here
     unsigned int fratio, gcd_fll;
                  ^

vim +/fratio +2790 sound/soc/codecs/wm8962.c

9a76f1ff Mark Brown      2010-08-05  2774  
9a76f1ff Mark Brown      2010-08-05  2775  	pr_debug("FLL Fvco=%dHz\n", target);
9a76f1ff Mark Brown      2010-08-05  2776  
25985edc Lucas De Marchi 2011-03-30  2777  	/* Find an appropriate FLL_FRATIO and factor it out of the target */
9a76f1ff Mark Brown      2010-08-05  2778  	for (i = 0; i < ARRAY_SIZE(fll_fratios); i++) {
9a76f1ff Mark Brown      2010-08-05  2779  		if (fll_fratios[i].min <= Fref && Fref <= fll_fratios[i].max) {
9a76f1ff Mark Brown      2010-08-05  2780  			fll_div->fll_fratio = fll_fratios[i].fll_fratio;
9a76f1ff Mark Brown      2010-08-05  2781  			fratio = fll_fratios[i].ratio;
9a76f1ff Mark Brown      2010-08-05  2782  			break;
9a76f1ff Mark Brown      2010-08-05  2783  		}
9a76f1ff Mark Brown      2010-08-05  2784  	}
9a76f1ff Mark Brown      2010-08-05  2785  	if (i == ARRAY_SIZE(fll_fratios)) {
9a76f1ff Mark Brown      2010-08-05  2786  		pr_err("Unable to find FLL_FRATIO for Fref=%uHz\n", Fref);
9a76f1ff Mark Brown      2010-08-05  2787  		return -EINVAL;
9a76f1ff Mark Brown      2010-08-05  2788  	}
9a76f1ff Mark Brown      2010-08-05  2789  
9a76f1ff Mark Brown      2010-08-05 @2790  	fll_div->n = target / (fratio * Fref);
9a76f1ff Mark Brown      2010-08-05  2791  
9a76f1ff Mark Brown      2010-08-05  2792  	if (target % Fref == 0) {
9a76f1ff Mark Brown      2010-08-05  2793  		fll_div->theta = 0;
9a76f1ff Mark Brown      2010-08-05  2794  		fll_div->lambda = 0;
9a76f1ff Mark Brown      2010-08-05  2795  	} else {
9a76f1ff Mark Brown      2010-08-05  2796  		gcd_fll = gcd(target, fratio * Fref);
9a76f1ff Mark Brown      2010-08-05  2797  
9a76f1ff Mark Brown      2010-08-05  2798  		fll_div->theta = (target - (fll_div->n * fratio * Fref))

:::::: The code at line 2790 was first introduced by commit
:::::: 9a76f1ff6e299fbb04149fe15aff061351fd0dab ASoC: Add initial WM8962 CODEC driver

:::::: TO: Mark Brown <broonie@opensource.wolfsonmicro.com>
:::::: CC: Mark Brown <broonie@opensource.wolfsonmicro.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 24943 bytes --]

             reply	other threads:[~2016-01-25  7:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-25  7:15 kbuild test robot [this message]
2016-01-25 16:01 ` [PATCH] ubsan: fix tree-wide -Wmaybe-uninitialized false positives Andrey Ryabinin
2016-01-25 21:41   ` Andrew Morton
2016-01-26 17:03     ` Andrey Ryabinin

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=201601251528.rosikkYN%fengguang.wu@intel.com \
    --to=fengguang.wu@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=aryabinin@virtuozzo.com \
    --cc=kbuild-all@01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /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;
as well as URLs for NNTP newsgroup(s).