All of lore.kernel.org
 help / color / mirror / Atom feed
* [intel-linux-intel-lts:5.4/yocto 1/2] arch/x86/kernel/tsc.c:1263:6: warning: variable 'rem' is used uninitialized whenever 'if' condition is false
@ 2021-06-25 15:46 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-06-25 15:46 UTC (permalink / raw)
  To: kbuild-all

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

tree:   https://github.com/intel/linux-intel-lts.git 5.4/yocto
head:   53cbd8c20c3f8e8afcc3482e6dd4c9400fc77dcd
commit: 056abbf6314ea7d95396062560c605f172e7535e [1/2] ptp: PSE TGPIO IOCTLs fix
config: x86_64-randconfig-r013-20210625 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 9ca0171a9ffdef5fdb1511d197a3fd72490362de)
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 x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # https://github.com/intel/linux-intel-lts/commit/056abbf6314ea7d95396062560c605f172e7535e
        git remote add intel-linux-intel-lts https://github.com/intel/linux-intel-lts.git
        git fetch --no-tags intel-linux-intel-lts 5.4/yocto
        git checkout 056abbf6314ea7d95396062560c605f172e7535e
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

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

>> arch/x86/kernel/tsc.c:1263:6: warning: variable 'rem' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
           if (art_to_tsc_numerator)
               ^~~~~~~~~~~~~~~~~~~~
   arch/x86/kernel/tsc.c:1267:8: note: uninitialized use occurs here
           tmp = rem * art_to_tsc_denominator;
                 ^~~
   arch/x86/kernel/tsc.c:1263:2: note: remove the 'if' if its condition is always true
           if (art_to_tsc_numerator)
           ^~~~~~~~~~~~~~~~~~~~~~~~~
   arch/x86/kernel/tsc.c:1257:19: note: initialize the variable 'rem' to silence this warning
           u64 tmp, res, rem;
                            ^
                             = 0
   1 warning generated.


vim +1263 arch/x86/kernel/tsc.c

  1244	
  1245	/**
  1246	 * convert_tsc_to_art() - Returns ART value associated with system counter
  1247	 *
  1248	 * Converts input TSC to the corresponding ART value using conversion
  1249	 * factors discovered by detect_art()
  1250	 *
  1251	 * Return:
  1252	 * u64 ART value
  1253	 */
  1254	int convert_tsc_to_art(const struct system_counterval_t *system_counter,
  1255			       u64 *art)
  1256	{
  1257		u64 tmp, res, rem;
  1258	
  1259		if (system_counter->cs != art_related_clocksource)
  1260			return -EINVAL;
  1261	
  1262		res = system_counter->cycles - art_to_tsc_offset;
> 1263		if (art_to_tsc_numerator)
  1264			rem = do_div(res, art_to_tsc_numerator);
  1265	
  1266		*art = res * art_to_tsc_denominator;
  1267		tmp = rem * art_to_tsc_denominator;
  1268	
  1269		if (art_to_tsc_numerator)
  1270			do_div(tmp, art_to_tsc_numerator);
  1271		*art += tmp;
  1272	
  1273		return 0;
  1274	}
  1275	EXPORT_SYMBOL(convert_tsc_to_art);
  1276	

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

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

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

only message in thread, other threads:[~2021-06-25 15:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-25 15:46 [intel-linux-intel-lts:5.4/yocto 1/2] arch/x86/kernel/tsc.c:1263:6: warning: variable 'rem' is used uninitialized whenever 'if' condition is false kernel test robot

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.