linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [stable:linux-5.10.y 3076/5321] drivers/clk/bcm/clk-bcm2835.c:943:6: warning: variable 'rem' set but not used
@ 2022-04-21 18:02 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2022-04-21 18:02 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: llvm, kbuild-all, linux-kernel, Greg Kroah-Hartman,
	Nicolas Saenz Julienne, Sasha Levin

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-5.10.y
head:   1052f9bce62982023737a95b7ff1ad26a5149af6
commit: b9c2343373f6bf19358db4e50197f5b3a17831db [3076/5321] clk: bcm-2835: Remove rounding up the dividers
config: arm-bcm2835_defconfig (https://download.01.org/0day-ci/archive/20220422/202204220101.mldVB7z8-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project bac6cd5bf85669e3376610cfc4c4f9ca015e7b9b)
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
        # install arm cross compiling tool for clang build
        # apt-get install binutils-arm-linux-gnueabi
        # https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/?id=b9c2343373f6bf19358db4e50197f5b3a17831db
        git remote add stable https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
        git fetch --no-tags stable linux-5.10.y
        git checkout b9c2343373f6bf19358db4e50197f5b3a17831db
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash drivers/clk/bcm/

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/clk/bcm/clk-bcm2835.c:943:6: warning: variable 'rem' set but not used [-Wunused-but-set-variable]
           u64 rem;
               ^
   1 warning generated.


vim +/rem +943 drivers/clk/bcm/clk-bcm2835.c

41691b8862e2a3 Eric Anholt   2015-10-08  933  
41691b8862e2a3 Eric Anholt   2015-10-08  934  static u32 bcm2835_clock_choose_div(struct clk_hw *hw,
41691b8862e2a3 Eric Anholt   2015-10-08  935  				    unsigned long rate,
b9c2343373f6bf Maxime Ripard 2021-09-22  936  				    unsigned long parent_rate)
41691b8862e2a3 Eric Anholt   2015-10-08  937  {
41691b8862e2a3 Eric Anholt   2015-10-08  938  	struct bcm2835_clock *clock = bcm2835_clock_from_hw(hw);
41691b8862e2a3 Eric Anholt   2015-10-08  939  	const struct bcm2835_clock_data *data = clock->data;
9c95b32ca09364 Remi Pommarel 2015-12-06  940  	u32 unused_frac_mask =
9c95b32ca09364 Remi Pommarel 2015-12-06  941  		GENMASK(CM_DIV_FRAC_BITS - data->frac_bits, 0) >> 1;
41691b8862e2a3 Eric Anholt   2015-10-08  942  	u64 temp = (u64)parent_rate << CM_DIV_FRAC_BITS;
9c95b32ca09364 Remi Pommarel 2015-12-06 @943  	u64 rem;
959ca92a3235fc Martin Sperl  2016-02-29  944  	u32 div, mindiv, maxdiv;
41691b8862e2a3 Eric Anholt   2015-10-08  945  
9c95b32ca09364 Remi Pommarel 2015-12-06  946  	rem = do_div(temp, rate);
41691b8862e2a3 Eric Anholt   2015-10-08  947  	div = temp;
41691b8862e2a3 Eric Anholt   2015-10-08  948  	div &= ~unused_frac_mask;
41691b8862e2a3 Eric Anholt   2015-10-08  949  
959ca92a3235fc Martin Sperl  2016-02-29  950  	/* different clamping limits apply for a mash clock */
959ca92a3235fc Martin Sperl  2016-02-29  951  	if (data->is_mash_clock) {
959ca92a3235fc Martin Sperl  2016-02-29  952  		/* clamp to min divider of 2 */
959ca92a3235fc Martin Sperl  2016-02-29  953  		mindiv = 2 << CM_DIV_FRAC_BITS;
959ca92a3235fc Martin Sperl  2016-02-29  954  		/* clamp to the highest possible integer divider */
959ca92a3235fc Martin Sperl  2016-02-29  955  		maxdiv = (BIT(data->int_bits) - 1) << CM_DIV_FRAC_BITS;
959ca92a3235fc Martin Sperl  2016-02-29  956  	} else {
997f16bd5d2e9b Martin Sperl  2016-02-29  957  		/* clamp to min divider of 1 */
959ca92a3235fc Martin Sperl  2016-02-29  958  		mindiv = 1 << CM_DIV_FRAC_BITS;
997f16bd5d2e9b Martin Sperl  2016-02-29  959  		/* clamp to the highest possible fractional divider */
959ca92a3235fc Martin Sperl  2016-02-29  960  		maxdiv = GENMASK(data->int_bits + CM_DIV_FRAC_BITS - 1,
959ca92a3235fc Martin Sperl  2016-02-29  961  				 CM_DIV_FRAC_BITS - data->frac_bits);
959ca92a3235fc Martin Sperl  2016-02-29  962  	}
959ca92a3235fc Martin Sperl  2016-02-29  963  
959ca92a3235fc Martin Sperl  2016-02-29  964  	/* apply the clamping  limits */
959ca92a3235fc Martin Sperl  2016-02-29  965  	div = max_t(u32, div, mindiv);
959ca92a3235fc Martin Sperl  2016-02-29  966  	div = min_t(u32, div, maxdiv);
41691b8862e2a3 Eric Anholt   2015-10-08  967  
41691b8862e2a3 Eric Anholt   2015-10-08  968  	return div;
41691b8862e2a3 Eric Anholt   2015-10-08  969  }
41691b8862e2a3 Eric Anholt   2015-10-08  970  

:::::: The code at line 943 was first introduced by commit
:::::: 9c95b32ca09364e4687b72c4e17b78dc1c420026 clk: bcm2835: add a round up ability to the clock divisor

:::::: TO: Remi Pommarel <repk@triplefau.lt>
:::::: CC: Michael Turquette <mturquette@baylibre.com>

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-04-21 18:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-21 18:02 [stable:linux-5.10.y 3076/5321] drivers/clk/bcm/clk-bcm2835.c:943:6: warning: variable 'rem' set but not used 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).