[linux-next:master 14156/15421] drivers/cpufreq/powernv-cpufreq.c:947:19: sparse: sparse: incorrect type in assignment (different base types)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   9e5cff2a1315fec1da1f497714395670366506b6
commit: b65e58ae2a09e89e5060bcd122a2cd6c66919d21 [14156/15421] include/linux/compiler-gcc.h: sparse can do constant folding of __builtin_bswap*()
config: powerpc64-randconfig-s031-20210429 (attached as .config)
compiler: powerpc64le-linux-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.3-341-g8af24329-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=b65e58ae2a09e89e5060bcd122a2cd6c66919d21
        git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout b65e58ae2a09e89e5060bcd122a2cd6c66919d21
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' W=1 ARCH=powerpc64 

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


sparse warnings: (new ones prefixed by >>)
>> drivers/cpufreq/powernv-cpufreq.c:947:19: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __be64 [usertype] type @@     got unsigned long long [usertype] @@
   drivers/cpufreq/powernv-cpufreq.c:947:19: sparse:     expected restricted __be64 [usertype] type
   drivers/cpufreq/powernv-cpufreq.c:947:19: sparse:     got unsigned long long [usertype]
>> drivers/cpufreq/powernv-cpufreq.c:970:27: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __be64 [usertype] chip @@     got unsigned long long [usertype] @@
   drivers/cpufreq/powernv-cpufreq.c:970:27: sparse:     expected restricted __be64 [usertype] chip
   drivers/cpufreq/powernv-cpufreq.c:970:27: sparse:     got unsigned long long [usertype]
>> drivers/cpufreq/powernv-cpufreq.c:971:38: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __be64 [usertype] throttle_status @@     got unsigned long long [usertype] @@
   drivers/cpufreq/powernv-cpufreq.c:971:38: sparse:     expected restricted __be64 [usertype] throttle_status
   drivers/cpufreq/powernv-cpufreq.c:971:38: sparse:     got unsigned long long [usertype]
   drivers/cpufreq/powernv-cpufreq.c:987:48: sparse: sparse: restricted __be64 degrades to integer
   drivers/cpufreq/powernv-cpufreq.c:990:25: sparse: sparse: restricted __be64 degrades to integer
   drivers/cpufreq/powernv-cpufreq.c:991:25: sparse: sparse: restricted __be64 degrades to integer
   drivers/cpufreq/powernv-cpufreq.c:992:50: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned char [usertype] throttle_reason @@     got restricted __be64 [usertype] throttle_status @@
   drivers/cpufreq/powernv-cpufreq.c:992:50: sparse:     expected unsigned char [usertype] throttle_reason
   drivers/cpufreq/powernv-cpufreq.c:992:50: sparse:     got restricted __be64 [usertype] throttle_status
   drivers/cpufreq/powernv-cpufreq.c:993:45: sparse: sparse: restricted __be64 degrades to integer
   drivers/cpufreq/powernv-cpufreq.c:949:21: sparse: sparse: restricted __be64 degrades to integer
   drivers/cpufreq/powernv-cpufreq.c:949:21: sparse: sparse: restricted __be64 degrades to integer

vim +947 drivers/cpufreq/powernv-cpufreq.c

735366fc407755 Shilpasri G Bhat 2015-07-16   936  
cb166fa937a2fb Shilpasri G Bhat 2015-07-16   937  static int powernv_cpufreq_occ_msg(struct notifier_block *nb,
cb166fa937a2fb Shilpasri G Bhat 2015-07-16   938  				   unsigned long msg_type, void *_msg)
cb166fa937a2fb Shilpasri G Bhat 2015-07-16   939  {
cb166fa937a2fb Shilpasri G Bhat 2015-07-16   940  	struct opal_msg *msg = _msg;
cb166fa937a2fb Shilpasri G Bhat 2015-07-16   941  	struct opal_occ_msg omsg;
735366fc407755 Shilpasri G Bhat 2015-07-16   942  	int i;
cb166fa937a2fb Shilpasri G Bhat 2015-07-16   943  
cb166fa937a2fb Shilpasri G Bhat 2015-07-16   944  	if (msg_type != OPAL_MSG_OCC)
cb166fa937a2fb Shilpasri G Bhat 2015-07-16   945  		return 0;
cb166fa937a2fb Shilpasri G Bhat 2015-07-16   946  
cb166fa937a2fb Shilpasri G Bhat 2015-07-16  @947  	omsg.type = be64_to_cpu(msg->params[0]);
cb166fa937a2fb Shilpasri G Bhat 2015-07-16   948  
cb166fa937a2fb Shilpasri G Bhat 2015-07-16   949  	switch (omsg.type) {
cb166fa937a2fb Shilpasri G Bhat 2015-07-16   950  	case OCC_RESET:
cb166fa937a2fb Shilpasri G Bhat 2015-07-16   951  		occ_reset = true;
309d0631cc329c Shilpasri G Bhat 2015-08-27   952  		pr_info("OCC (On Chip Controller - enforces hard thermal/power limits) Resetting\n");
cb166fa937a2fb Shilpasri G Bhat 2015-07-16   953  		/*
cb166fa937a2fb Shilpasri G Bhat 2015-07-16   954  		 * powernv_cpufreq_throttle_check() is called in
cb166fa937a2fb Shilpasri G Bhat 2015-07-16   955  		 * target() callback which can detect the throttle state
cb166fa937a2fb Shilpasri G Bhat 2015-07-16   956  		 * for governors like ondemand.
cb166fa937a2fb Shilpasri G Bhat 2015-07-16   957  		 * But static governors will not call target() often thus
cb166fa937a2fb Shilpasri G Bhat 2015-07-16   958  		 * report throttling here.
cb166fa937a2fb Shilpasri G Bhat 2015-07-16   959  		 */
cb166fa937a2fb Shilpasri G Bhat 2015-07-16   960  		if (!throttled) {
cb166fa937a2fb Shilpasri G Bhat 2015-07-16   961  			throttled = true;
c89f2682a39192 Shilpasri G Bhat 2016-02-03   962  			pr_warn("CPU frequency is throttled for duration\n");
cb166fa937a2fb Shilpasri G Bhat 2015-07-16   963  		}
309d0631cc329c Shilpasri G Bhat 2015-08-27   964  
cb166fa937a2fb Shilpasri G Bhat 2015-07-16   965  		break;
cb166fa937a2fb Shilpasri G Bhat 2015-07-16   966  	case OCC_LOAD:
309d0631cc329c Shilpasri G Bhat 2015-08-27   967  		pr_info("OCC Loading, CPU frequency is throttled until OCC is started\n");
cb166fa937a2fb Shilpasri G Bhat 2015-07-16   968  		break;
cb166fa937a2fb Shilpasri G Bhat 2015-07-16   969  	case OCC_THROTTLE:
cb166fa937a2fb Shilpasri G Bhat 2015-07-16  @970  		omsg.chip = be64_to_cpu(msg->params[1]);
cb166fa937a2fb Shilpasri G Bhat 2015-07-16  @971  		omsg.throttle_status = be64_to_cpu(msg->params[2]);
cb166fa937a2fb Shilpasri G Bhat 2015-07-16   972  
cb166fa937a2fb Shilpasri G Bhat 2015-07-16   973  		if (occ_reset) {
cb166fa937a2fb Shilpasri G Bhat 2015-07-16   974  			occ_reset = false;
cb166fa937a2fb Shilpasri G Bhat 2015-07-16   975  			throttled = false;
309d0631cc329c Shilpasri G Bhat 2015-08-27   976  			pr_info("OCC Active, CPU frequency is no longer throttled\n");
735366fc407755 Shilpasri G Bhat 2015-07-16   977  
227942809b52f2 Shilpasri G Bhat 2015-07-16   978  			for (i = 0; i < nr_chips; i++) {
227942809b52f2 Shilpasri G Bhat 2015-07-16   979  				chips[i].restore = true;
735366fc407755 Shilpasri G Bhat 2015-07-16   980  				schedule_work(&chips[i].throttle);
227942809b52f2 Shilpasri G Bhat 2015-07-16   981  			}
735366fc407755 Shilpasri G Bhat 2015-07-16   982  
cb166fa937a2fb Shilpasri G Bhat 2015-07-16   983  			return 0;
cb166fa937a2fb Shilpasri G Bhat 2015-07-16   984  		}
cb166fa937a2fb Shilpasri G Bhat 2015-07-16   985  
c89f2682a39192 Shilpasri G Bhat 2016-02-03   986  		for (i = 0; i < nr_chips; i++)
c89f2682a39192 Shilpasri G Bhat 2016-02-03   987  			if (chips[i].id == omsg.chip)
c89f2682a39192 Shilpasri G Bhat 2016-02-03   988  				break;
c89f2682a39192 Shilpasri G Bhat 2016-02-03   989  
c89f2682a39192 Shilpasri G Bhat 2016-02-03   990  		if (omsg.throttle_status >= 0 &&
1b0289848d5dce Shilpasri G Bhat 2016-03-22   991  		    omsg.throttle_status <= OCC_MAX_THROTTLE_STATUS) {
c89f2682a39192 Shilpasri G Bhat 2016-02-03   992  			chips[i].throttle_reason = omsg.throttle_status;
1b0289848d5dce Shilpasri G Bhat 2016-03-22   993  			chips[i].reason[omsg.throttle_status]++;
1b0289848d5dce Shilpasri G Bhat 2016-03-22   994  		}
735366fc407755 Shilpasri G Bhat 2015-07-16   995  
227942809b52f2 Shilpasri G Bhat 2015-07-16   996  		if (!omsg.throttle_status)
227942809b52f2 Shilpasri G Bhat 2015-07-16   997  			chips[i].restore = true;
c89f2682a39192 Shilpasri G Bhat 2016-02-03   998  
735366fc407755 Shilpasri G Bhat 2015-07-16   999  		schedule_work(&chips[i].throttle);
cb166fa937a2fb Shilpasri G Bhat 2015-07-16  1000  	}
cb166fa937a2fb Shilpasri G Bhat 2015-07-16  1001  	return 0;
cb166fa937a2fb Shilpasri G Bhat 2015-07-16  1002  }
cb166fa937a2fb Shilpasri G Bhat 2015-07-16  1003  

:::::: The code at line 947 was first introduced by commit
:::::: cb166fa937a2fbc14badcafca86202354c34a213 cpufreq: powernv: Register for OCC related opal_message notification

:::::: TO: Shilpasri G Bhat <shilpa.bhat@xxxxxxxxxxxxxxxxxx>
:::::: CC: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>

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

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux