linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* drivers/clocksource/timer-pistachio.c:74:22: warning: variable 'overflow' set but not used
@ 2021-11-11 23:05 kernel test robot
  2021-11-14 21:29 ` Drew Fustini
  0 siblings, 1 reply; 7+ messages in thread
From: kernel test robot @ 2021-11-11 23:05 UTC (permalink / raw)
  To: Drew Fustini; +Cc: kbuild-all, linux-kernel, Daniel Lezcano

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

Hi Drew,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   debe436e77c72fcee804fb867f275e6d31aa999c
commit: a47d7ef4550d08fb428ea4c3f1a9c71674212208 clocksource/drivers/pistachio: Fix trivial typo
date:   7 months ago
config: mips-randconfig-r012-20210927 (attached as .config)
compiler: mips-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a47d7ef4550d08fb428ea4c3f1a9c71674212208
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout a47d7ef4550d08fb428ea4c3f1a9c71674212208
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=mips 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   drivers/clocksource/timer-pistachio.c: In function 'pistachio_clocksource_read_cycles':
>> drivers/clocksource/timer-pistachio.c:74:22: warning: variable 'overflow' set but not used [-Wunused-but-set-variable]
      74 |         u32 counter, overflow;
         |                      ^~~~~~~~


vim +/overflow +74 drivers/clocksource/timer-pistachio.c

    69	
    70	static u64 notrace
    71	pistachio_clocksource_read_cycles(struct clocksource *cs)
    72	{
    73		struct pistachio_clocksource *pcs = to_pistachio_clocksource(cs);
  > 74		u32 counter, overflow;
    75		unsigned long flags;
    76	
    77		/*
    78		 * The counter value is only refreshed after the overflow value is read.
    79		 * And they must be read in strict order, hence raw spin lock added.
    80		 */
    81	
    82		raw_spin_lock_irqsave(&pcs->lock, flags);
    83		overflow = gpt_readl(pcs->base, TIMER_CURRENT_OVERFLOW_VALUE, 0);
    84		counter = gpt_readl(pcs->base, TIMER_CURRENT_VALUE, 0);
    85		raw_spin_unlock_irqrestore(&pcs->lock, flags);
    86	
    87		return (u64)~counter;
    88	}
    89	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 28875 bytes --]

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

* Re: drivers/clocksource/timer-pistachio.c:74:22: warning: variable 'overflow' set but not used
  2021-11-11 23:05 drivers/clocksource/timer-pistachio.c:74:22: warning: variable 'overflow' set but not used kernel test robot
@ 2021-11-14 21:29 ` Drew Fustini
  2021-11-14 22:17   ` Daniel Lezcano
  0 siblings, 1 reply; 7+ messages in thread
From: Drew Fustini @ 2021-11-14 21:29 UTC (permalink / raw)
  To: kernel test robot
  Cc: kbuild-all, linux-kernel, Daniel Lezcano, Gustavo A. R. Silva

On Fri, Nov 12, 2021 at 07:05:48AM +0800, kernel test robot wrote:
> Hi Drew,
> 
> FYI, the error/warning still remains.
> 
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head:   debe436e77c72fcee804fb867f275e6d31aa999c
> commit: a47d7ef4550d08fb428ea4c3f1a9c71674212208 clocksource/drivers/pistachio: Fix trivial typo
> date:   7 months ago
> config: mips-randconfig-r012-20210927 (attached as .config)
> compiler: mips-linux-gcc (GCC) 11.2.0
> reproduce (this is a W=1 build):
>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a47d7ef4550d08fb428ea4c3f1a9c71674212208
>         git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>         git fetch --no-tags linus master
>         git checkout a47d7ef4550d08fb428ea4c3f1a9c71674212208
>         # save the attached .config to linux build tree
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=mips 
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
> 
> All warnings (new ones prefixed by >>):
> 
>    drivers/clocksource/timer-pistachio.c: In function 'pistachio_clocksource_read_cycles':
> >> drivers/clocksource/timer-pistachio.c:74:22: warning: variable 'overflow' set but not used [-Wunused-but-set-variable]
>       74 |         u32 counter, overflow;
>          |                      ^~~~~~~~
> 
> 
> vim +/overflow +74 drivers/clocksource/timer-pistachio.c
> 
>     69	
>     70	static u64 notrace
>     71	pistachio_clocksource_read_cycles(struct clocksource *cs)
>     72	{
>     73		struct pistachio_clocksource *pcs = to_pistachio_clocksource(cs);
>   > 74		u32 counter, overflow;
>     75		unsigned long flags;
>     76	
>     77		/*
>     78		 * The counter value is only refreshed after the overflow value is read.
>     79		 * And they must be read in strict order, hence raw spin lock added.
>     80		 */
>     81	
>     82		raw_spin_lock_irqsave(&pcs->lock, flags);
>     83		overflow = gpt_readl(pcs->base, TIMER_CURRENT_OVERFLOW_VALUE, 0);

I fail to see how variable 'overflow' set but not used as the return
value of gpt_readl() is unconditionally assigned to 'overflow'.

Am I missing something?

Thanks,
Drew

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

* Re: drivers/clocksource/timer-pistachio.c:74:22: warning: variable 'overflow' set but not used
  2021-11-14 21:29 ` Drew Fustini
@ 2021-11-14 22:17   ` Daniel Lezcano
  2021-11-15  1:02     ` Drew Fustini
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Lezcano @ 2021-11-14 22:17 UTC (permalink / raw)
  To: Drew Fustini, kernel test robot
  Cc: kbuild-all, linux-kernel, Gustavo A. R. Silva

On 14/11/2021 22:29, Drew Fustini wrote:
> On Fri, Nov 12, 2021 at 07:05:48AM +0800, kernel test robot wrote:
>> Hi Drew,
>>
>> FYI, the error/warning still remains.
>>
>> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
>> head:   debe436e77c72fcee804fb867f275e6d31aa999c
>> commit: a47d7ef4550d08fb428ea4c3f1a9c71674212208 clocksource/drivers/pistachio: Fix trivial typo
>> date:   7 months ago
>> config: mips-randconfig-r012-20210927 (attached as .config)
>> compiler: mips-linux-gcc (GCC) 11.2.0
>> reproduce (this is a W=1 build):
>>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>>         chmod +x ~/bin/make.cross
>>         # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a47d7ef4550d08fb428ea4c3f1a9c71674212208
>>         git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>>         git fetch --no-tags linus master
>>         git checkout a47d7ef4550d08fb428ea4c3f1a9c71674212208
>>         # save the attached .config to linux build tree
>>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=mips 
>>
>> If you fix the issue, kindly add following tag as appropriate
>> Reported-by: kernel test robot <lkp@intel.com>
>>
>> All warnings (new ones prefixed by >>):
>>
>>    drivers/clocksource/timer-pistachio.c: In function 'pistachio_clocksource_read_cycles':
>>>> drivers/clocksource/timer-pistachio.c:74:22: warning: variable 'overflow' set but not used [-Wunused-but-set-variable]
>>       74 |         u32 counter, overflow;
>>          |                      ^~~~~~~~
>>
>>
>> vim +/overflow +74 drivers/clocksource/timer-pistachio.c
>>
>>     69	
>>     70	static u64 notrace
>>     71	pistachio_clocksource_read_cycles(struct clocksource *cs)
>>     72	{
>>     73		struct pistachio_clocksource *pcs = to_pistachio_clocksource(cs);
>>   > 74		u32 counter, overflow;
>>     75		unsigned long flags;
>>     76	
>>     77		/*
>>     78		 * The counter value is only refreshed after the overflow value is read.
>>     79		 * And they must be read in strict order, hence raw spin lock added.
>>     80		 */
>>     81	
>>     82		raw_spin_lock_irqsave(&pcs->lock, flags);
>>     83		overflow = gpt_readl(pcs->base, TIMER_CURRENT_OVERFLOW_VALUE, 0);

overflow is set here but then never reused in the function. So a call to
gpt_readl without getting the return value is fine.

The warning is different from 'variable is unused'

> I fail to see how variable 'overflow' set but not used as the return
> value of gpt_readl() is unconditionally assigned to 'overflow'.




-- 
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

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

* Re: drivers/clocksource/timer-pistachio.c:74:22: warning: variable 'overflow' set but not used
  2021-11-14 22:17   ` Daniel Lezcano
@ 2021-11-15  1:02     ` Drew Fustini
  2021-11-15 12:22       ` Daniel Lezcano
  0 siblings, 1 reply; 7+ messages in thread
From: Drew Fustini @ 2021-11-15  1:02 UTC (permalink / raw)
  To: Daniel Lezcano
  Cc: kernel test robot, kbuild-all, linux-kernel, Gustavo A. R. Silva

On Sun, Nov 14, 2021 at 11:17:38PM +0100, Daniel Lezcano wrote:
> On 14/11/2021 22:29, Drew Fustini wrote:
> > On Fri, Nov 12, 2021 at 07:05:48AM +0800, kernel test robot wrote:
> >> Hi Drew,
> >>
> >> FYI, the error/warning still remains.
> >>
> >> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> >> head:   debe436e77c72fcee804fb867f275e6d31aa999c
> >> commit: a47d7ef4550d08fb428ea4c3f1a9c71674212208 clocksource/drivers/pistachio: Fix trivial typo
> >> date:   7 months ago
> >> config: mips-randconfig-r012-20210927 (attached as .config)
> >> compiler: mips-linux-gcc (GCC) 11.2.0
> >> reproduce (this is a W=1 build):
> >>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> >>         chmod +x ~/bin/make.cross
> >>         # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a47d7ef4550d08fb428ea4c3f1a9c71674212208
> >>         git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> >>         git fetch --no-tags linus master
> >>         git checkout a47d7ef4550d08fb428ea4c3f1a9c71674212208
> >>         # save the attached .config to linux build tree
> >>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=mips 
> >>
> >> If you fix the issue, kindly add following tag as appropriate
> >> Reported-by: kernel test robot <lkp@intel.com>
> >>
> >> All warnings (new ones prefixed by >>):
> >>
> >>    drivers/clocksource/timer-pistachio.c: In function 'pistachio_clocksource_read_cycles':
> >>>> drivers/clocksource/timer-pistachio.c:74:22: warning: variable 'overflow' set but not used [-Wunused-but-set-variable]
> >>       74 |         u32 counter, overflow;
> >>          |                      ^~~~~~~~
> >>
> >>
> >> vim +/overflow +74 drivers/clocksource/timer-pistachio.c
> >>
> >>     69	
> >>     70	static u64 notrace
> >>     71	pistachio_clocksource_read_cycles(struct clocksource *cs)
> >>     72	{
> >>     73		struct pistachio_clocksource *pcs = to_pistachio_clocksource(cs);
> >>   > 74		u32 counter, overflow;
> >>     75		unsigned long flags;
> >>     76	
> >>     77		/*
> >>     78		 * The counter value is only refreshed after the overflow value is read.
> >>     79		 * And they must be read in strict order, hence raw spin lock added.
> >>     80		 */
> >>     81	
> >>     82		raw_spin_lock_irqsave(&pcs->lock, flags);
> >>     83		overflow = gpt_readl(pcs->base, TIMER_CURRENT_OVERFLOW_VALUE, 0);
> 
> overflow is set here but then never reused in the function. So a call to
> gpt_readl without getting the return value is fine.
> 
> The warning is different from 'variable is unused'

Thank you for pointing that out.  I was reading it incorrectly.

As for this function, it seems that warning is a false positive as
the act of reading TIMER_CURRENT_OVERFLOW_VALUE causes the hardware
to refresh TIMER_CURRENT_VALUE.

Thanks,
Drew

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

* Re: drivers/clocksource/timer-pistachio.c:74:22: warning: variable 'overflow' set but not used
  2021-11-15  1:02     ` Drew Fustini
@ 2021-11-15 12:22       ` Daniel Lezcano
  0 siblings, 0 replies; 7+ messages in thread
From: Daniel Lezcano @ 2021-11-15 12:22 UTC (permalink / raw)
  To: Drew Fustini
  Cc: kernel test robot, kbuild-all, linux-kernel, Gustavo A. R. Silva

On 15/11/2021 02:02, Drew Fustini wrote:
> On Sun, Nov 14, 2021 at 11:17:38PM +0100, Daniel Lezcano wrote:
>> On 14/11/2021 22:29, Drew Fustini wrote:
>>> On Fri, Nov 12, 2021 at 07:05:48AM +0800, kernel test robot wrote:
>>>> Hi Drew,
>>>>
>>>> FYI, the error/warning still remains.
>>>>
>>>> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
>>>> head:   debe436e77c72fcee804fb867f275e6d31aa999c
>>>> commit: a47d7ef4550d08fb428ea4c3f1a9c71674212208 clocksource/drivers/pistachio: Fix trivial typo
>>>> date:   7 months ago
>>>> config: mips-randconfig-r012-20210927 (attached as .config)
>>>> compiler: mips-linux-gcc (GCC) 11.2.0
>>>> reproduce (this is a W=1 build):
>>>>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>>>>         chmod +x ~/bin/make.cross
>>>>         # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a47d7ef4550d08fb428ea4c3f1a9c71674212208
>>>>         git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>>>>         git fetch --no-tags linus master
>>>>         git checkout a47d7ef4550d08fb428ea4c3f1a9c71674212208
>>>>         # save the attached .config to linux build tree
>>>>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=mips 
>>>>
>>>> If you fix the issue, kindly add following tag as appropriate
>>>> Reported-by: kernel test robot <lkp@intel.com>
>>>>
>>>> All warnings (new ones prefixed by >>):
>>>>
>>>>    drivers/clocksource/timer-pistachio.c: In function 'pistachio_clocksource_read_cycles':
>>>>>> drivers/clocksource/timer-pistachio.c:74:22: warning: variable 'overflow' set but not used [-Wunused-but-set-variable]
>>>>       74 |         u32 counter, overflow;
>>>>          |                      ^~~~~~~~
>>>>
>>>>
>>>> vim +/overflow +74 drivers/clocksource/timer-pistachio.c
>>>>
>>>>     69	
>>>>     70	static u64 notrace
>>>>     71	pistachio_clocksource_read_cycles(struct clocksource *cs)
>>>>     72	{
>>>>     73		struct pistachio_clocksource *pcs = to_pistachio_clocksource(cs);
>>>>   > 74		u32 counter, overflow;
>>>>     75		unsigned long flags;
>>>>     76	
>>>>     77		/*
>>>>     78		 * The counter value is only refreshed after the overflow value is read.
>>>>     79		 * And they must be read in strict order, hence raw spin lock added.
>>>>     80		 */
>>>>     81	
>>>>     82		raw_spin_lock_irqsave(&pcs->lock, flags);
>>>>     83		overflow = gpt_readl(pcs->base, TIMER_CURRENT_OVERFLOW_VALUE, 0);
>>
>> overflow is set here but then never reused in the function. So a call to
>> gpt_readl without getting the return value is fine.
>>
>> The warning is different from 'variable is unused'
> 
> Thank you for pointing that out.  I was reading it incorrectly.
> 
> As for this function, it seems that warning is a false positive as
> the act of reading TIMER_CURRENT_OVERFLOW_VALUE causes the hardware
> to refresh TIMER_CURRENT_VALUE.

The warning is actually not a false positive. It just state the variable
is unused after setting it which is actually correct.

The indirect warning is about the behavior of the hardware where the
counter is refreshed only when the overflow is read.

May be adding the may_be_unused annotation to the overflow variable can
silent the warning?


-- 
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

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

* drivers/clocksource/timer-pistachio.c:74:22: warning: variable 'overflow' set but not used
@ 2021-11-19 20:37 kernel test robot
  0 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2021-11-19 20:37 UTC (permalink / raw)
  To: Drew Fustini; +Cc: kbuild-all, linux-kernel, Daniel Lezcano

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

Hi Drew,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   4c388a8e740d3235a194f330c8ef327deef710f6
commit: a47d7ef4550d08fb428ea4c3f1a9c71674212208 clocksource/drivers/pistachio: Fix trivial typo
date:   8 months ago
config: mips-randconfig-r012-20210927 (attached as .config)
compiler: mips-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a47d7ef4550d08fb428ea4c3f1a9c71674212208
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout a47d7ef4550d08fb428ea4c3f1a9c71674212208
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=mips 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   drivers/clocksource/timer-pistachio.c: In function 'pistachio_clocksource_read_cycles':
>> drivers/clocksource/timer-pistachio.c:74:22: warning: variable 'overflow' set but not used [-Wunused-but-set-variable]
      74 |         u32 counter, overflow;
         |                      ^~~~~~~~


vim +/overflow +74 drivers/clocksource/timer-pistachio.c

    69	
    70	static u64 notrace
    71	pistachio_clocksource_read_cycles(struct clocksource *cs)
    72	{
    73		struct pistachio_clocksource *pcs = to_pistachio_clocksource(cs);
  > 74		u32 counter, overflow;
    75		unsigned long flags;
    76	
    77		/*
    78		 * The counter value is only refreshed after the overflow value is read.
    79		 * And they must be read in strict order, hence raw spin lock added.
    80		 */
    81	
    82		raw_spin_lock_irqsave(&pcs->lock, flags);
    83		overflow = gpt_readl(pcs->base, TIMER_CURRENT_OVERFLOW_VALUE, 0);
    84		counter = gpt_readl(pcs->base, TIMER_CURRENT_VALUE, 0);
    85		raw_spin_unlock_irqrestore(&pcs->lock, flags);
    86	
    87		return (u64)~counter;
    88	}
    89	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 28875 bytes --]

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

* drivers/clocksource/timer-pistachio.c:74:22: warning: variable 'overflow' set but not used
@ 2021-09-27 17:02 kernel test robot
  0 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2021-09-27 17:02 UTC (permalink / raw)
  To: Drew Fustini; +Cc: kbuild-all, linux-kernel, Daniel Lezcano

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   92477dd1faa650e50bd3bb35a6c0b8d09198cc35
commit: a47d7ef4550d08fb428ea4c3f1a9c71674212208 clocksource/drivers/pistachio: Fix trivial typo
date:   6 months ago
config: mips-randconfig-r012-20210927 (attached as .config)
compiler: mips-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a47d7ef4550d08fb428ea4c3f1a9c71674212208
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout a47d7ef4550d08fb428ea4c3f1a9c71674212208
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=mips 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   drivers/clocksource/timer-pistachio.c: In function 'pistachio_clocksource_read_cycles':
>> drivers/clocksource/timer-pistachio.c:74:22: warning: variable 'overflow' set but not used [-Wunused-but-set-variable]
      74 |         u32 counter, overflow;
         |                      ^~~~~~~~


vim +/overflow +74 drivers/clocksource/timer-pistachio.c

    69	
    70	static u64 notrace
    71	pistachio_clocksource_read_cycles(struct clocksource *cs)
    72	{
    73		struct pistachio_clocksource *pcs = to_pistachio_clocksource(cs);
  > 74		u32 counter, overflow;
    75		unsigned long flags;
    76	
    77		/*
    78		 * The counter value is only refreshed after the overflow value is read.
    79		 * And they must be read in strict order, hence raw spin lock added.
    80		 */
    81	
    82		raw_spin_lock_irqsave(&pcs->lock, flags);
    83		overflow = gpt_readl(pcs->base, TIMER_CURRENT_OVERFLOW_VALUE, 0);
    84		counter = gpt_readl(pcs->base, TIMER_CURRENT_VALUE, 0);
    85		raw_spin_unlock_irqrestore(&pcs->lock, flags);
    86	
    87		return (u64)~counter;
    88	}
    89	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 28875 bytes --]

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

end of thread, other threads:[~2021-11-19 20:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-11 23:05 drivers/clocksource/timer-pistachio.c:74:22: warning: variable 'overflow' set but not used kernel test robot
2021-11-14 21:29 ` Drew Fustini
2021-11-14 22:17   ` Daniel Lezcano
2021-11-15  1:02     ` Drew Fustini
2021-11-15 12:22       ` Daniel Lezcano
  -- strict thread matches above, loose matches on Subject: below --
2021-11-19 20:37 kernel test robot
2021-09-27 17:02 kernel test robot

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