mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [drm-misc:for-linux-next-fixes 2/11] drivers/clk/bcm/clk-bcm2835.c:942:13: warning: variable 'rem' set but not used
@ 2021-10-13 22:36 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-10-13 22:36 UTC (permalink / raw)
  To: Maxime Ripard; +Cc: kbuild-all, linux-kernel, Nicolas Saenz Julienne

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

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@intel.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@triplefau.lt>
:::::: CC: Michael Turquette <mturquette@baylibre.com>

---
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: 33206 bytes --]

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

only message in thread, other threads:[~2021-10-13 22:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-13 22:36 [drm-misc:for-linux-next-fixes 2/11] drivers/clk/bcm/clk-bcm2835.c:942:13: 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

all inboxes | Powered by JetHome®