linux-mm.kvack.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, Andrew Morton <akpm@linux-foundation.org>,
	Linux Memory Management List <linux-mm@kvack.org>
Subject: [linux-next:master 11446/11650] drivers/pwm/pwm-atmel-hlcdc.c:75:55: warning: 'clk_period_ns' may be used uninitialized in this function
Date: Fri, 15 Jan 2016 16:56:05 +0800	[thread overview]
Message-ID: <201601151603.wGuE709l%fengguang.wu@intel.com> (raw)

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   39750fe2d360d6f1ccdc6b33d0a5cb624c97a5fd
commit: df423af30988b62df3905601742b8948bbbce329 [11446/11650] UBSAN: run-time undefined behavior sanity checker
config: x86_64-randconfig-s5-01151613 (attached as .config)
reproduce:
        git checkout df423af30988b62df3905601742b8948bbbce329
        # 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 >>):

   drivers/pwm/pwm-atmel-hlcdc.c: In function 'atmel_hlcdc_pwm_config':
>> drivers/pwm/pwm-atmel-hlcdc.c:75:55: warning: 'clk_period_ns' may be used uninitialized in this function [-Wmaybe-uninitialized]
     if ((chip->errata && chip->errata->slow_clk_erratum) ||
                                                          ^

vim +/clk_period_ns +75 drivers/pwm/pwm-atmel-hlcdc.c

2b4984be Boris Brezillon 2014-10-07  59  	u64 pwmcval = duty_ns * 256;
2b4984be Boris Brezillon 2014-10-07  60  	unsigned long clk_freq;
2b4984be Boris Brezillon 2014-10-07  61  	u64 clk_period_ns;
2b4984be Boris Brezillon 2014-10-07  62  	u32 pwmcfg;
2b4984be Boris Brezillon 2014-10-07  63  	int pres;
2b4984be Boris Brezillon 2014-10-07  64  
39e046f2 Boris BREZILLON 2014-11-19  65  	if (!chip->errata || !chip->errata->slow_clk_erratum) {
2b4984be Boris Brezillon 2014-10-07  66  		clk_freq = clk_get_rate(new_clk);
df6922ad Boris BREZILLON 2014-12-18  67  		if (!clk_freq)
df6922ad Boris BREZILLON 2014-12-18  68  			return -EINVAL;
df6922ad Boris BREZILLON 2014-12-18  69  
2b4984be Boris Brezillon 2014-10-07  70  		clk_period_ns = (u64)NSEC_PER_SEC * 256;
2b4984be Boris Brezillon 2014-10-07  71  		do_div(clk_period_ns, clk_freq);
39e046f2 Boris BREZILLON 2014-11-19  72  	}
2b4984be Boris Brezillon 2014-10-07  73  
39e046f2 Boris BREZILLON 2014-11-19  74  	/* Errata: cannot use slow clk on some IP revisions */
39e046f2 Boris BREZILLON 2014-11-19 @75  	if ((chip->errata && chip->errata->slow_clk_erratum) ||
39e046f2 Boris BREZILLON 2014-11-19  76  	    clk_period_ns > period_ns) {
2b4984be Boris Brezillon 2014-10-07  77  		new_clk = hlcdc->sys_clk;
2b4984be Boris Brezillon 2014-10-07  78  		clk_freq = clk_get_rate(new_clk);
df6922ad Boris BREZILLON 2014-12-18  79  		if (!clk_freq)
df6922ad Boris BREZILLON 2014-12-18  80  			return -EINVAL;
df6922ad Boris BREZILLON 2014-12-18  81  
2b4984be Boris Brezillon 2014-10-07  82  		clk_period_ns = (u64)NSEC_PER_SEC * 256;
2b4984be Boris Brezillon 2014-10-07  83  		do_div(clk_period_ns, clk_freq);

:::::: The code at line 75 was first introduced by commit
:::::: 39e046f2c1dd0742976d7ee6e464744cf2122f41 pwm: atmel-hlcdc: add at91sam9x5 and sama5d3 errata handling

:::::: TO: Boris BREZILLON <boris.brezillon@free-electrons.com>
:::::: CC: Thierry Reding <thierry.reding@gmail.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: 20771 bytes --]

             reply	other threads:[~2016-01-15  8:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-15  8:56 kbuild test robot [this message]
2016-01-15 16:17 ` 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=201601151603.wGuE709l%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-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