lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202110140630.uaEULPWy-lkp@intel.com>
Date:   Thu, 14 Oct 2021 06:36:38 +0800
From:   kernel test robot <lkp@...el.com>
To:     Maxime Ripard <maxime@...no.tech>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
        Nicolas Saenz Julienne <nsaenz@...nel.org>
Subject: [drm-misc:for-linux-next-fixes 2/11]
 drivers/clk/bcm/clk-bcm2835.c:942:13: warning: variable 'rem' set but not
 used

tree:   git://anongit.freedesktop.org/drm/drm-misc for-linux-next-fixes
head:   6de148d82d9e790caf7622a002229df745fd2d94
commit: 6f668b61142fb7dbc66a659ecdd9afe55d40fc08 [2/11] clk: bcm-2835: Remove rounding up the dividers
config: nios2-randconfig-r002-20211013 (attached as .config)
compiler: nios2-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
        git remote add drm-misc git://anongit.freedesktop.org/drm/drm-misc
        git fetch --no-tags drm-misc for-linux-next-fixes
        git checkout 6f668b61142fb7dbc66a659ecdd9afe55d40fc08
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=nios2 

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

All warnings (new ones prefixed by >>):

   drivers/clk/bcm/clk-bcm2835.c: In function 'bcm2835_clock_choose_div':
>> drivers/clk/bcm/clk-bcm2835.c:942:13: warning: variable 'rem' set but not used [-Wunused-but-set-variable]
     942 |         u64 rem;
         |             ^~~


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

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

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

:::::: TO: Remi Pommarel <repk@...plefau.lt>
:::::: CC: Michael Turquette <mturquette@...libre.com>

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

Download attachment ".config.gz" of type "application/gzip" (33206 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ