linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* sound/soc/codecs/wm8962.c:2790:32: warning: 'fratio' may be used uninitialized in this function
@ 2016-01-25  7:15 kbuild test robot
  2016-01-25 16:01 ` [PATCH] ubsan: fix tree-wide -Wmaybe-uninitialized false positives Andrey Ryabinin
  0 siblings, 1 reply; 4+ messages in thread
From: kbuild test robot @ 2016-01-25  7:15 UTC (permalink / raw)
  To: Andrey Ryabinin
  Cc: kbuild-all, linux-kernel, Andrew Morton,
	Linux Memory Management List

[-- 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 --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-01-26 17:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-25  7:15 sound/soc/codecs/wm8962.c:2790:32: warning: 'fratio' may be used uninitialized in this function kbuild test robot
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

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).