All of lore.kernel.org
 help / color / mirror / Atom feed
From: Drew Fustini <drew@beagleboard.org>
To: kbuild-all@lists.01.org
Subject: Re: drivers/clocksource/timer-pistachio.c:74:22: warning: variable 'overflow' set but not used
Date: Sun, 14 Nov 2021 13:29:38 -0800	[thread overview]
Message-ID: <20211114212938.GA317441@x1> (raw)
In-Reply-To: <202111120738.oAGjK5L8-lkp@intel.com>

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

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

WARNING: multiple messages have this Message-ID (diff)
From: Drew Fustini <drew@beagleboard.org>
To: kernel test robot <lkp@intel.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	"Gustavo A. R. Silva" <gustavoars@kernel.org>
Subject: Re: drivers/clocksource/timer-pistachio.c:74:22: warning: variable 'overflow' set but not used
Date: Sun, 14 Nov 2021 13:29:38 -0800	[thread overview]
Message-ID: <20211114212938.GA317441@x1> (raw)
In-Reply-To: <202111120738.oAGjK5L8-lkp@intel.com>

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

  reply	other threads:[~2021-11-14 21:29 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-11 23:05 drivers/clocksource/timer-pistachio.c:74:22: warning: variable 'overflow' set but not used kernel test robot
2021-11-11 23:05 ` kernel test robot
2021-11-14 21:29 ` Drew Fustini [this message]
2021-11-14 21:29   ` Drew Fustini
2021-11-14 22:17   ` Daniel Lezcano
2021-11-14 22:17     ` Daniel Lezcano
2021-11-15  1:02     ` Drew Fustini
2021-11-15  1:02       ` Drew Fustini
2021-11-15 12:22       ` Daniel Lezcano
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-11-19 20:37 ` kernel test robot
2021-09-27 17:02 kernel test robot
2021-09-27 17:02 ` kernel test robot

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=20211114212938.GA317441@x1 \
    --to=drew@beagleboard.org \
    --cc=kbuild-all@lists.01.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.