* drivers/firmware/thead,th1520-aon.c:173:22: sparse: sparse: incorrect type in assignment (different base types)
@ 2026-09-22 6:44 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-09-22 6:44 UTC (permalink / raw)
To: Michal Wilczynski; +Cc: oe-kbuild-all, linux-kernel, Ulf Hansson, Dan Carpenter
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: f0100363d8c374bd8e9ea7c9ba02744f0b802ca4
commit: 88c4bd90725557796c15878b7cb70066e9e6b5ab firmware: thead: Fix buffer overflow and use standard endian macros
date: 6 months ago
config: microblaze-randconfig-r1301-20260922 (https://download.01.org/0day-ci/archive/20260922/202609221307.brMpIrTW-lkp@intel.com/config)
compiler: microblaze-linux-gcc (GCC) 8.5.0
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260922/202609221307.brMpIrTW-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Fixes: 88c4bd907255 ("firmware: thead: Fix buffer overflow and use standard endian macros")
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202609221307.brMpIrTW-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> drivers/firmware/thead,th1520-aon.c:173:22: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [addressable] [usertype] resource @@ got restricted __be16 [usertype] @@
drivers/firmware/thead,th1520-aon.c:173:22: sparse: expected unsigned short [addressable] [usertype] resource
drivers/firmware/thead,th1520-aon.c:173:22: sparse: got restricted __be16 [usertype]
>> drivers/firmware/thead,th1520-aon.c:174:18: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [addressable] [usertype] mode @@ got restricted __be16 [usertype] @@
drivers/firmware/thead,th1520-aon.c:174:18: sparse: expected unsigned short [addressable] [usertype] mode
drivers/firmware/thead,th1520-aon.c:174:18: sparse: got restricted __be16 [usertype]
vim +173 drivers/firmware/thead,th1520-aon.c
143
144 /**
145 * th1520_aon_power_update() - Change power state of a resource via TH1520 AON
146 * @aon_chan: Pointer to the AON channel structure
147 * @rsrc: Resource ID whose power state needs to be updated
148 * @power_on: Boolean indicating whether the resource should be powered on (true)
149 * or powered off (false)
150 *
151 * This function requests the TH1520 AON subsystem to set the power mode of the
152 * given resource (@rsrc) to either on or off. It constructs the message in
153 * `struct th1520_aon_msg_req_set_resource_power_mode` and then invokes
154 * th1520_aon_call_rpc() to make the request. If the AON call fails, an error
155 * message is logged along with the specific return code.
156 *
157 * Return:
158 * * 0 on success
159 * * A negative error code in case of failures (propagated from
160 * th1520_aon_call_rpc()).
161 */
162 int th1520_aon_power_update(struct th1520_aon_chan *aon_chan, u16 rsrc,
163 bool power_on)
164 {
165 struct th1520_aon_msg_req_set_resource_power_mode msg = {};
166 struct th1520_aon_rpc_msg_hdr *hdr = &msg.hdr;
167 int ret;
168
169 hdr->svc = TH1520_AON_RPC_SVC_PM;
170 hdr->func = TH1520_AON_PM_FUNC_SET_RESOURCE_POWER_MODE;
171 hdr->size = TH1520_AON_RPC_MSG_NUM;
172
> 173 msg.resource = cpu_to_be16(rsrc);
> 174 msg.mode = cpu_to_be16(power_on ? TH1520_AON_PM_PW_MODE_ON :
175 TH1520_AON_PM_PW_MODE_OFF);
176
177 ret = th1520_aon_call_rpc(aon_chan, &msg);
178 if (ret)
179 dev_err(aon_chan->cl.dev, "failed to power %s resource %d ret %d\n",
180 power_on ? "up" : "off", rsrc, ret);
181
182 return ret;
183 }
184 EXPORT_SYMBOL_GPL(th1520_aon_power_update);
185
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-09-22 6:46 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-22 6:44 drivers/firmware/thead,th1520-aon.c:173:22: 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
all inboxes | Powered by JetHome®