mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Michal Wilczynski <m.wilczynski@samsung.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Dan Carpenter <error27@gmail.com>
Subject: drivers/firmware/thead,th1520-aon.c:173:22: sparse: sparse: incorrect type in assignment (different base types)
Date: Tue, 22 Sep 2026 14:44:31 +0800	[thread overview]
Message-ID: <202609221307.brMpIrTW-lkp@intel.com> (raw)

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

                 reply	other threads:[~2026-09-22  6:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202609221307.brMpIrTW-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=error27@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.wilczynski@samsung.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=ulf.hansson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®