linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* drivers/interconnect/qcom/icc-rpmh.c:132:28: sparse: sparse: incorrect type in assignment (different base types)
@ 2020-07-06 12:41 kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2020-07-06 12:41 UTC (permalink / raw)
  To: David Dai
  Cc: kbuild-all, linux-kernel, Georgi Djakov, Odelu Kukatla,
	Evan Green, Sibi Sankar

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   dcb7fd82c75ee2d6e6f9d8cc71c52519ed52e258
commit: 976daac4a1c581e5d5fd64047519fd6fcde39738 interconnect: qcom: Consolidate interconnect RPMh support
date:   4 months ago
config: arm64-randconfig-s032-20200706 (attached as .config)
compiler: aarch64-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.2-14-g8fce3d7a-dirty
        git checkout 976daac4a1c581e5d5fd64047519fd6fcde39738
        # 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__' ARCH=arm64 

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


sparse warnings: (new ones prefixed by >>)

>> drivers/interconnect/qcom/icc-rpmh.c:132:28: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __le32 [usertype] unit @@     got unsigned int [usertype] @@
>> drivers/interconnect/qcom/icc-rpmh.c:132:28: sparse:     expected restricted __le32 [usertype] unit
>> drivers/interconnect/qcom/icc-rpmh.c:132:28: sparse:     got unsigned int [usertype]
>> drivers/interconnect/qcom/icc-rpmh.c:133:29: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __le16 [usertype] width @@     got unsigned short [usertype] @@
>> drivers/interconnect/qcom/icc-rpmh.c:133:29: sparse:     expected restricted __le16 [usertype] width
>> drivers/interconnect/qcom/icc-rpmh.c:133:29: sparse:     got unsigned short [usertype]
--
>> drivers/interconnect/qcom/bcm-voter.c:64:78: sparse: sparse: restricted __le16 degrades to integer
   drivers/interconnect/qcom/bcm-voter.c:68:79: sparse: sparse: restricted __le16 degrades to integer
>> drivers/interconnect/qcom/bcm-voter.c:74:17: sparse: sparse: incorrect type in initializer (different base types) @@     expected unsigned int [usertype] __base @@     got restricted __le32 [usertype] unit @@
>> drivers/interconnect/qcom/bcm-voter.c:74:17: sparse:     expected unsigned int [usertype] __base
>> drivers/interconnect/qcom/bcm-voter.c:74:17: sparse:     got restricted __le32 [usertype] unit
   drivers/interconnect/qcom/bcm-voter.c:78:17: sparse: sparse: incorrect type in initializer (different base types) @@     expected unsigned int [usertype] __base @@     got restricted __le32 [usertype] unit @@
   drivers/interconnect/qcom/bcm-voter.c:78:17: sparse:     expected unsigned int [usertype] __base
   drivers/interconnect/qcom/bcm-voter.c:78:17: sparse:     got restricted __le32 [usertype] unit
>> drivers/interconnect/qcom/bcm-voter.c:109:21: sparse: sparse: restricted __le32 degrades to integer
>> drivers/interconnect/qcom/bcm-voter.c:109:21: sparse: sparse: restricted __le32 degrades to integer

vim +132 drivers/interconnect/qcom/icc-rpmh.c

    94	
    95	/**
    96	 * qcom_icc_bcm_init - populates bcm aux data and connect qnodes
    97	 * @bcm: bcm to be initialized
    98	 * @dev: associated provider device
    99	 *
   100	 * Return: 0 on success, or an error code otherwise
   101	 */
   102	int qcom_icc_bcm_init(struct qcom_icc_bcm *bcm, struct device *dev)
   103	{
   104		struct qcom_icc_node *qn;
   105		const struct bcm_db *data;
   106		size_t data_count;
   107		int i;
   108	
   109		/* BCM is already initialised*/
   110		if (bcm->addr)
   111			return 0;
   112	
   113		bcm->addr = cmd_db_read_addr(bcm->name);
   114		if (!bcm->addr) {
   115			dev_err(dev, "%s could not find RPMh address\n",
   116				bcm->name);
   117			return -EINVAL;
   118		}
   119	
   120		data = cmd_db_read_aux_data(bcm->name, &data_count);
   121		if (IS_ERR(data)) {
   122			dev_err(dev, "%s command db read error (%ld)\n",
   123				bcm->name, PTR_ERR(data));
   124			return PTR_ERR(data);
   125		}
   126		if (!data_count) {
   127			dev_err(dev, "%s command db missing or partial aux data\n",
   128				bcm->name);
   129			return -EINVAL;
   130		}
   131	
 > 132		bcm->aux_data.unit = le32_to_cpu(data->unit);
 > 133		bcm->aux_data.width = le16_to_cpu(data->width);
   134		bcm->aux_data.vcd = data->vcd;
   135		bcm->aux_data.reserved = data->reserved;
   136		INIT_LIST_HEAD(&bcm->list);
   137		INIT_LIST_HEAD(&bcm->ws_list);
   138	
   139		/* Link Qnodes to their respective BCMs */
   140		for (i = 0; i < bcm->num_nodes; i++) {
   141			qn = bcm->nodes[i];
   142			qn->bcms[qn->num_bcms] = bcm;
   143			qn->num_bcms++;
   144		}
   145	
   146		return 0;
   147	}
   148	EXPORT_SYMBOL_GPL(qcom_icc_bcm_init);
   149	

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* drivers/interconnect/qcom/icc-rpmh.c:132:28: sparse: sparse: incorrect type in assignment (different base types)
@ 2021-01-24  9:28 kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2021-01-24  9:28 UTC (permalink / raw)
  To: Jonathan Marek; +Cc: kbuild-all, linux-kernel, Georgi Djakov, Sibi Sankar

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

Hi Jonathan,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   e1ae4b0be15891faf46d390e9f3dc9bd71a8cae1
commit: 6df5b349491ef269147df8127883d9acffde835e interconnect: qcom: Add SM8250 interconnect provider driver
date:   5 months ago
config: arm64-randconfig-s031-20210124 (attached as .config)
compiler: aarch64-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-208-g46a52ca4-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6df5b349491ef269147df8127883d9acffde835e
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 6df5b349491ef269147df8127883d9acffde835e
        # 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__' ARCH=arm64 

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


"sparse warnings: (new ones prefixed by >>)"
>> drivers/interconnect/qcom/icc-rpmh.c:132:28: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __le32 [usertype] unit @@     got unsigned int @@
   drivers/interconnect/qcom/icc-rpmh.c:132:28: sparse:     expected restricted __le32 [usertype] unit
   drivers/interconnect/qcom/icc-rpmh.c:132:28: sparse:     got unsigned int
>> drivers/interconnect/qcom/icc-rpmh.c:133:29: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __le16 [usertype] width @@     got int @@
   drivers/interconnect/qcom/icc-rpmh.c:133:29: sparse:     expected restricted __le16 [usertype] width
   drivers/interconnect/qcom/icc-rpmh.c:133:29: sparse:     got int

vim +132 drivers/interconnect/qcom/icc-rpmh.c

976daac4a1c581e5 David Dai 2020-02-28   94  
976daac4a1c581e5 David Dai 2020-02-28   95  /**
976daac4a1c581e5 David Dai 2020-02-28   96   * qcom_icc_bcm_init - populates bcm aux data and connect qnodes
976daac4a1c581e5 David Dai 2020-02-28   97   * @bcm: bcm to be initialized
976daac4a1c581e5 David Dai 2020-02-28   98   * @dev: associated provider device
976daac4a1c581e5 David Dai 2020-02-28   99   *
976daac4a1c581e5 David Dai 2020-02-28  100   * Return: 0 on success, or an error code otherwise
976daac4a1c581e5 David Dai 2020-02-28  101   */
976daac4a1c581e5 David Dai 2020-02-28  102  int qcom_icc_bcm_init(struct qcom_icc_bcm *bcm, struct device *dev)
976daac4a1c581e5 David Dai 2020-02-28  103  {
976daac4a1c581e5 David Dai 2020-02-28  104  	struct qcom_icc_node *qn;
976daac4a1c581e5 David Dai 2020-02-28  105  	const struct bcm_db *data;
976daac4a1c581e5 David Dai 2020-02-28  106  	size_t data_count;
976daac4a1c581e5 David Dai 2020-02-28  107  	int i;
976daac4a1c581e5 David Dai 2020-02-28  108  
976daac4a1c581e5 David Dai 2020-02-28  109  	/* BCM is already initialised*/
976daac4a1c581e5 David Dai 2020-02-28  110  	if (bcm->addr)
976daac4a1c581e5 David Dai 2020-02-28  111  		return 0;
976daac4a1c581e5 David Dai 2020-02-28  112  
976daac4a1c581e5 David Dai 2020-02-28  113  	bcm->addr = cmd_db_read_addr(bcm->name);
976daac4a1c581e5 David Dai 2020-02-28  114  	if (!bcm->addr) {
976daac4a1c581e5 David Dai 2020-02-28  115  		dev_err(dev, "%s could not find RPMh address\n",
976daac4a1c581e5 David Dai 2020-02-28  116  			bcm->name);
976daac4a1c581e5 David Dai 2020-02-28  117  		return -EINVAL;
976daac4a1c581e5 David Dai 2020-02-28  118  	}
976daac4a1c581e5 David Dai 2020-02-28  119  
976daac4a1c581e5 David Dai 2020-02-28  120  	data = cmd_db_read_aux_data(bcm->name, &data_count);
976daac4a1c581e5 David Dai 2020-02-28  121  	if (IS_ERR(data)) {
976daac4a1c581e5 David Dai 2020-02-28  122  		dev_err(dev, "%s command db read error (%ld)\n",
976daac4a1c581e5 David Dai 2020-02-28  123  			bcm->name, PTR_ERR(data));
976daac4a1c581e5 David Dai 2020-02-28  124  		return PTR_ERR(data);
976daac4a1c581e5 David Dai 2020-02-28  125  	}
976daac4a1c581e5 David Dai 2020-02-28  126  	if (!data_count) {
976daac4a1c581e5 David Dai 2020-02-28  127  		dev_err(dev, "%s command db missing or partial aux data\n",
976daac4a1c581e5 David Dai 2020-02-28  128  			bcm->name);
976daac4a1c581e5 David Dai 2020-02-28  129  		return -EINVAL;
976daac4a1c581e5 David Dai 2020-02-28  130  	}
976daac4a1c581e5 David Dai 2020-02-28  131  
976daac4a1c581e5 David Dai 2020-02-28 @132  	bcm->aux_data.unit = le32_to_cpu(data->unit);
976daac4a1c581e5 David Dai 2020-02-28 @133  	bcm->aux_data.width = le16_to_cpu(data->width);
976daac4a1c581e5 David Dai 2020-02-28  134  	bcm->aux_data.vcd = data->vcd;
976daac4a1c581e5 David Dai 2020-02-28  135  	bcm->aux_data.reserved = data->reserved;
976daac4a1c581e5 David Dai 2020-02-28  136  	INIT_LIST_HEAD(&bcm->list);
976daac4a1c581e5 David Dai 2020-02-28  137  	INIT_LIST_HEAD(&bcm->ws_list);
976daac4a1c581e5 David Dai 2020-02-28  138  
976daac4a1c581e5 David Dai 2020-02-28  139  	/* Link Qnodes to their respective BCMs */
976daac4a1c581e5 David Dai 2020-02-28  140  	for (i = 0; i < bcm->num_nodes; i++) {
976daac4a1c581e5 David Dai 2020-02-28  141  		qn = bcm->nodes[i];
976daac4a1c581e5 David Dai 2020-02-28  142  		qn->bcms[qn->num_bcms] = bcm;
976daac4a1c581e5 David Dai 2020-02-28  143  		qn->num_bcms++;
976daac4a1c581e5 David Dai 2020-02-28  144  	}
976daac4a1c581e5 David Dai 2020-02-28  145  
976daac4a1c581e5 David Dai 2020-02-28  146  	return 0;
976daac4a1c581e5 David Dai 2020-02-28  147  }
976daac4a1c581e5 David Dai 2020-02-28  148  EXPORT_SYMBOL_GPL(qcom_icc_bcm_init);
976daac4a1c581e5 David Dai 2020-02-28  149  

:::::: The code at line 132 was first introduced by commit
:::::: 976daac4a1c581e5d5fd64047519fd6fcde39738 interconnect: qcom: Consolidate interconnect RPMh support

:::::: TO: David Dai <daidavid1@codeaurora.org>
:::::: CC: Georgi Djakov <georgi.djakov@linaro.org>

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* drivers/interconnect/qcom/icc-rpmh.c:132:28: sparse: sparse: incorrect type in assignment (different base types)
@ 2020-12-02 14:27 kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2020-12-02 14:27 UTC (permalink / raw)
  To: David Dai
  Cc: kbuild-all, linux-kernel, Georgi Djakov, Odelu Kukatla,
	Evan Green, Sibi Sankar

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   509a15421674b9e1a3e1916939d0d0efd3e578da
commit: 976daac4a1c581e5d5fd64047519fd6fcde39738 interconnect: qcom: Consolidate interconnect RPMh support
date:   9 months ago
config: arm64-randconfig-s032-20201202 (attached as .config)
compiler: aarch64-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-179-ga00755aa-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=976daac4a1c581e5d5fd64047519fd6fcde39738
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 976daac4a1c581e5d5fd64047519fd6fcde39738
        # 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__' ARCH=arm64 

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


"sparse warnings: (new ones prefixed by >>)"
>> drivers/interconnect/qcom/icc-rpmh.c:132:28: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __le32 [usertype] unit @@     got unsigned int [usertype] @@
   drivers/interconnect/qcom/icc-rpmh.c:132:28: sparse:     expected restricted __le32 [usertype] unit
   drivers/interconnect/qcom/icc-rpmh.c:132:28: sparse:     got unsigned int [usertype]
>> drivers/interconnect/qcom/icc-rpmh.c:133:29: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __le16 [usertype] width @@     got unsigned short [usertype] @@
   drivers/interconnect/qcom/icc-rpmh.c:133:29: sparse:     expected restricted __le16 [usertype] width
   drivers/interconnect/qcom/icc-rpmh.c:133:29: sparse:     got unsigned short [usertype]

vim +132 drivers/interconnect/qcom/icc-rpmh.c

    94	
    95	/**
    96	 * qcom_icc_bcm_init - populates bcm aux data and connect qnodes
    97	 * @bcm: bcm to be initialized
    98	 * @dev: associated provider device
    99	 *
   100	 * Return: 0 on success, or an error code otherwise
   101	 */
   102	int qcom_icc_bcm_init(struct qcom_icc_bcm *bcm, struct device *dev)
   103	{
   104		struct qcom_icc_node *qn;
   105		const struct bcm_db *data;
   106		size_t data_count;
   107		int i;
   108	
   109		/* BCM is already initialised*/
   110		if (bcm->addr)
   111			return 0;
   112	
   113		bcm->addr = cmd_db_read_addr(bcm->name);
   114		if (!bcm->addr) {
   115			dev_err(dev, "%s could not find RPMh address\n",
   116				bcm->name);
   117			return -EINVAL;
   118		}
   119	
   120		data = cmd_db_read_aux_data(bcm->name, &data_count);
   121		if (IS_ERR(data)) {
   122			dev_err(dev, "%s command db read error (%ld)\n",
   123				bcm->name, PTR_ERR(data));
   124			return PTR_ERR(data);
   125		}
   126		if (!data_count) {
   127			dev_err(dev, "%s command db missing or partial aux data\n",
   128				bcm->name);
   129			return -EINVAL;
   130		}
   131	
 > 132		bcm->aux_data.unit = le32_to_cpu(data->unit);
 > 133		bcm->aux_data.width = le16_to_cpu(data->width);
   134		bcm->aux_data.vcd = data->vcd;
   135		bcm->aux_data.reserved = data->reserved;
   136		INIT_LIST_HEAD(&bcm->list);
   137		INIT_LIST_HEAD(&bcm->ws_list);
   138	
   139		/* Link Qnodes to their respective BCMs */
   140		for (i = 0; i < bcm->num_nodes; i++) {
   141			qn = bcm->nodes[i];
   142			qn->bcms[qn->num_bcms] = bcm;
   143			qn->num_bcms++;
   144		}
   145	
   146		return 0;
   147	}
   148	EXPORT_SYMBOL_GPL(qcom_icc_bcm_init);
   149	

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-01-24  9:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-06 12:41 drivers/interconnect/qcom/icc-rpmh.c:132:28: sparse: sparse: incorrect type in assignment (different base types) kernel test robot
2020-12-02 14:27 kernel test robot
2021-01-24  9:28 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).