From: kernel test robot <lkp@intel.com>
To: Conor Dooley <conor.dooley@microchip.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: drivers/firmware/microchip/mpfs-auto-update.c:387:72-78: ERROR: application of sizeof to pointer
Date: Mon, 4 Mar 2024 05:09:14 +0800 [thread overview]
Message-ID: <202403040516.CYxoWTXw-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 58c806d867bf265c6fd16fc3bc62e2d3c156b5c9
commit: ec5b0f1193ad461e53d083edad8fab0298fe68e3 firmware: microchip: add PolarFire SoC Auto Update support
date: 3 months ago
config: microblaze-randconfig-r061-20240303 (https://download.01.org/0day-ci/archive/20240304/202403040516.CYxoWTXw-lkp@intel.com/config)
compiler: microblaze-linux-gcc (GCC) 13.2.0
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
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202403040516.CYxoWTXw-lkp@intel.com/
cocci warnings: (new ones prefixed by >>)
>> drivers/firmware/microchip/mpfs-auto-update.c:387:72-78: ERROR: application of sizeof to pointer
drivers/firmware/microchip/mpfs-auto-update.c:170:72-78: ERROR: application of sizeof to pointer
vim +387 drivers/firmware/microchip/mpfs-auto-update.c
379
380 static int mpfs_auto_update_available(struct mpfs_auto_update_priv *priv)
381 {
382 struct mpfs_mss_response *response;
383 struct mpfs_mss_msg *message;
384 u32 *response_msg;
385 int ret;
386
> 387 response_msg = devm_kzalloc(priv->dev, AUTO_UPDATE_FEATURE_RESP_SIZE * sizeof(response_msg),
388 GFP_KERNEL);
389 if (!response_msg)
390 return -ENOMEM;
391
392 response = devm_kzalloc(priv->dev, sizeof(struct mpfs_mss_response), GFP_KERNEL);
393 if (!response)
394 return -ENOMEM;
395
396 message = devm_kzalloc(priv->dev, sizeof(struct mpfs_mss_msg), GFP_KERNEL);
397 if (!message)
398 return -ENOMEM;
399
400 /*
401 * To verify that Auto Update is possible, the "Query Security Service
402 * Request" is performed.
403 * This service has no command data & does not overload mbox_offset.
404 */
405 response->resp_msg = response_msg;
406 response->resp_size = AUTO_UPDATE_FEATURE_RESP_SIZE;
407 message->cmd_opcode = AUTO_UPDATE_FEATURE_CMD_OPCODE;
408 message->cmd_data_size = AUTO_UPDATE_FEATURE_CMD_DATA_SIZE;
409 message->response = response;
410 message->cmd_data = AUTO_UPDATE_FEATURE_CMD_DATA;
411 message->mbox_offset = AUTO_UPDATE_DEFAULT_MBOX_OFFSET;
412 message->resp_offset = AUTO_UPDATE_DEFAULT_RESP_OFFSET;
413
414 ret = mpfs_blocking_transaction(priv->sys_controller, message);
415 if (ret)
416 return ret;
417
418 /*
419 * Currently, the system controller's firmware does not generate any
420 * interrupts for failed services, so mpfs_blocking_transaction() should
421 * time out & therefore return an error.
422 * Hitting this check is highly unlikely at present, but if the system
423 * controller's behaviour changes so that it does generate interrupts
424 * for failed services, it will be required.
425 */
426 if (response->resp_status)
427 return -EIO;
428
429 /*
430 * Bit 5 of byte 1 is "UL_Auto Update" & if it is set, Auto Update is
431 * not possible.
432 */
433 if (response_msg[1] & AUTO_UPDATE_FEATURE_ENABLED)
434 return -EPERM;
435
436 return 0;
437 }
438
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2024-03-03 21:10 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=202403040516.CYxoWTXw-lkp@intel.com \
--to=lkp@intel.com \
--cc=conor.dooley@microchip.com \
--cc=linux-kernel@vger.kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
/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®