Re: [PATCH v4 4/4] firmware: imx: secvio: Add support for SNVS secvio and tamper via SCFW

From: kernel test robot
Date: Thu Dec 05 2024 - 11:19:28 EST


Hi Vabhav,

kernel test robot noticed the following build warnings:

[auto build test WARNING on 9852d85ec9d492ebef56dc5f229416c925758edc]

url: https://github.com/intel-lab-lkp/linux/commits/Vabhav-Sharma/dt-bindings-firmware-imx-add-nvmem-phandle/20241205-125909
base: 9852d85ec9d492ebef56dc5f229416c925758edc
patch link: https://lore.kernel.org/r/20241205-secvio-v4-4-5c37cdc39573%40nxp.com
patch subject: [PATCH v4 4/4] firmware: imx: secvio: Add support for SNVS secvio and tamper via SCFW
config: nios2-randconfig-r063-20241205 (https://download.01.org/0day-ci/archive/20241206/202412060014.woL5otGn-lkp@xxxxxxxxx/config)
compiler: nios2-linux-gcc (GCC) 14.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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202412060014.woL5otGn-lkp@xxxxxxxxx/

cocci warnings: (new ones prefixed by >>)
>> drivers/firmware/imx/imx-scu-secvio.c:368:11-29: WARNING opportunity for simple_open, see also structure on line 419

vim +368 drivers/firmware/imx/imx-scu-secvio.c

367
> 368 static int imx_secvio_sc_open(struct inode *node, struct file *filp)
369 {
370 filp->private_data = node->i_private;
371
372 return 0;
373 }
374
375 static long imx_secvio_sc_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
376 {
377 struct device *dev = file->private_data;
378 struct secvio_sc_notifier_info info;
379 int ret;
380
381 switch (cmd) {
382 case IMX_SECVIO_SC_GET_STATE:
383 ret = imx_secvio_sc_get_state(dev, &info);
384 if (ret)
385 return ret;
386
387 ret = copy_to_user((void __user *)arg, &info, sizeof(info));
388 if (ret) {
389 dev_err(dev, "Fail to copy info to user\n");
390 return -EFAULT;
391 }
392 break;
393 case IMX_SECVIO_SC_CHECK_STATE:
394 ret = imx_secvio_sc_check_state(dev);
395 if (ret)
396 return ret;
397 break;
398 case IMX_SECVIO_SC_CLEAR_STATE:
399 ret = copy_from_user(&info, (void __user *)arg, sizeof(info));
400 if (ret) {
401 dev_err(dev, "Fail to copy info from user\n");
402 return -EFAULT;
403 }
404
405 ret = imx_secvio_sc_clear_state(dev, info.hpsvs, info.lps,
406 info.lptds);
407 if (ret)
408 return ret;
409 break;
410 default:
411 ret = -ENOIOCTLCMD;
412 }
413
414 return ret;
415 }
416
417 static const struct file_operations imx_secvio_sc_fops = {
418 .owner = THIS_MODULE,
> 419 .open = imx_secvio_sc_open,
420 .unlocked_ioctl = imx_secvio_sc_ioctl,
421 };
422

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