GNU/Weeb Mailing List <[email protected]>
 help / color / mirror / Atom feed
* [ammarfaizi2-block:google/android/kernel/common/android-gs-raviole-5.10-s-v2-beta-3 1454/9999] drivers/firmware/arm_scmi/voltage.c:159:42: sparse: sparse: incorrect type in assignment (different base types)
@ 2023-03-30  5:17 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-03-30  5:17 UTC (permalink / raw)
  To: Ammar Faizi, GNU/Weeb Mailing List; +Cc: oe-kbuild-all

tree:   https://github.com/ammarfaizi2/linux-block google/android/kernel/common/android-gs-raviole-5.10-s-v2-beta-3
head:   51e133b6e4eb00703d3b3fe71cc2447ebd9fb4a8
commit: fb2b659b60bd79ee04a042ab6f89eb25481127a8 [1454/9999] UPSTREAM: firmware: arm_scmi: Add voltage domain management protocol support
config: arm-randconfig-s033-20230326 (https://download.01.org/0day-ci/archive/20230330/[email protected]/config)
compiler: arm-linux-gnueabi-gcc (GCC) 12.1.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.4-39-gce1a6720-dirty
        # https://github.com/ammarfaizi2/linux-block/commit/fb2b659b60bd79ee04a042ab6f89eb25481127a8
        git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block
        git fetch --no-tags ammarfaizi2-block google/android/kernel/common/android-gs-raviole-5.10-s-v2-beta-3
        git checkout fb2b659b60bd79ee04a042ab6f89eb25481127a8
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arm olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arm SHELL=/bin/bash drivers/firmware/arm_scmi/ fs/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <[email protected]>
| Link: https://lore.kernel.org/oe-kbuild-all/[email protected]/

sparse warnings: (new ones prefixed by >>)
>> drivers/firmware/arm_scmi/voltage.c:159:42: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __le32 [usertype] level_index @@     got unsigned int [usertype] desc_index @@
   drivers/firmware/arm_scmi/voltage.c:159:42: sparse:     expected restricted __le32 [usertype] level_index
   drivers/firmware/arm_scmi/voltage.c:159:42: sparse:     got unsigned int [usertype] desc_index

vim +159 drivers/firmware/arm_scmi/voltage.c

   111	
   112	static int scmi_voltage_descriptors_get(const struct scmi_handle *handle,
   113						struct voltage_info *vinfo)
   114	{
   115		int ret, dom;
   116		struct scmi_xfer *td, *tl;
   117		struct device *dev = handle->dev;
   118		struct scmi_msg_resp_domain_attributes *resp_dom;
   119		struct scmi_msg_resp_describe_levels *resp_levels;
   120	
   121		ret = scmi_xfer_get_init(handle, VOLTAGE_DOMAIN_ATTRIBUTES,
   122					 SCMI_PROTOCOL_VOLTAGE, sizeof(__le32),
   123					 sizeof(*resp_dom), &td);
   124		if (ret)
   125			return ret;
   126		resp_dom = td->rx.buf;
   127	
   128		ret = scmi_xfer_get_init(handle, VOLTAGE_DESCRIBE_LEVELS,
   129					 SCMI_PROTOCOL_VOLTAGE, sizeof(__le64), 0, &tl);
   130		if (ret)
   131			goto outd;
   132		resp_levels = tl->rx.buf;
   133	
   134		for (dom = 0; dom < vinfo->num_domains; dom++) {
   135			u32 desc_index = 0;
   136			u16 num_returned = 0, num_remaining = 0;
   137			struct scmi_msg_cmd_describe_levels *cmd;
   138			struct scmi_voltage_info *v;
   139	
   140			/* Retrieve domain attributes at first ... */
   141			put_unaligned_le32(dom, td->tx.buf);
   142			ret = scmi_do_xfer(handle, td);
   143			/* Skip domain on comms error */
   144			if (ret)
   145				continue;
   146	
   147			v = vinfo->domains + dom;
   148			v->id = dom;
   149			v->attributes = le32_to_cpu(resp_dom->attr);
   150			strlcpy(v->name, resp_dom->name, SCMI_MAX_STR_SIZE);
   151	
   152			cmd = tl->tx.buf;
   153			/* ...then retrieve domain levels descriptions */
   154			do {
   155				u32 flags;
   156				int cnt;
   157	
   158				cmd->domain_id = cpu_to_le32(v->id);
 > 159				cmd->level_index = desc_index;
   160				ret = scmi_do_xfer(handle, tl);
   161				if (ret)
   162					break;
   163	
   164				flags = le32_to_cpu(resp_levels->flags);
   165				num_returned = NUM_RETURNED_LEVELS(flags);
   166				num_remaining = NUM_REMAINING_LEVELS(flags);
   167	
   168				/* Allocate space for num_levels if not already done */
   169				if (!v->num_levels) {
   170					ret = scmi_init_voltage_levels(dev, v,
   171								       num_returned,
   172								       num_remaining,
   173						      SUPPORTS_SEGMENTED_LEVELS(flags));
   174					if (ret)
   175						break;
   176				}
   177	
   178				if (desc_index + num_returned > v->num_levels) {
   179					dev_err(handle->dev,
   180						"No. of voltage levels can't exceed %d\n",
   181						v->num_levels);
   182					ret = -EINVAL;
   183					break;
   184				}
   185	
   186				for (cnt = 0; cnt < num_returned; cnt++) {
   187					s32 val;
   188	
   189					val =
   190					    (s32)le32_to_cpu(resp_levels->voltage[cnt]);
   191					v->levels_uv[desc_index + cnt] = val;
   192					if (val < 0)
   193						v->negative_volts_allowed = true;
   194				}
   195	
   196				desc_index += num_returned;
   197	
   198				scmi_reset_rx_to_maxsz(handle, tl);
   199				/* check both to avoid infinite loop due to buggy fw */
   200			} while (num_returned && num_remaining);
   201	
   202			if (ret) {
   203				v->num_levels = 0;
   204				devm_kfree(dev, v->levels_uv);
   205			}
   206	
   207			scmi_reset_rx_to_maxsz(handle, td);
   208		}
   209	
   210		scmi_xfer_put(handle, tl);
   211	outd:
   212		scmi_xfer_put(handle, td);
   213	
   214		return ret;
   215	}
   216	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests

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

only message in thread, other threads:[~2023-03-30  5:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-30  5:17 [ammarfaizi2-block:google/android/kernel/common/android-gs-raviole-5.10-s-v2-beta-3 1454/9999] drivers/firmware/arm_scmi/voltage.c:159:42: sparse: sparse: incorrect type in assignment (different base types) 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