[sailus-media-tree:devel 23/23] drivers/media/platform/st/stm32/stm32-dcmi.c:1685:21: error: call to undeclared function 'devm_kmemdup_array'; ISO C99 and later do not support implicit function declarations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   git://linuxtv.org/sailus/media_tree.git devel
head:   07e07f2cd3ebb7e8b62ccb8f22a16032b599c9e2
commit: 07e07f2cd3ebb7e8b62ccb8f22a16032b599c9e2 [23/23] media: stm32-dcmi: use devm_kmemdup_array()
config: hexagon-allyesconfig (https://download.01.org/0day-ci/archive/20250311/202503110853.F2zqgdx0-lkp@xxxxxxxxx/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250311/202503110853.F2zqgdx0-lkp@xxxxxxxxx/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
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202503110853.F2zqgdx0-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

>> drivers/media/platform/st/stm32/stm32-dcmi.c:1685:21: error: call to undeclared function 'devm_kmemdup_array'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    1685 |         dcmi->sd_formats = devm_kmemdup_array(dcmi->dev, sd_fmts, num_fmts,
         |                            ^
>> drivers/media/platform/st/stm32/stm32-dcmi.c:1685:19: error: incompatible integer to pointer conversion assigning to 'const struct dcmi_format **' from 'int' [-Wint-conversion]
    1685 |         dcmi->sd_formats = devm_kmemdup_array(dcmi->dev, sd_fmts, num_fmts,
         |                          ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1686 |                                               sizeof(sd_fmts[0]), GFP_KERNEL);
         |                                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   2 errors generated.


vim +/devm_kmemdup_array +1685 drivers/media/platform/st/stm32/stm32-dcmi.c

  1639	
  1640	static int dcmi_formats_init(struct stm32_dcmi *dcmi)
  1641	{
  1642		const struct dcmi_format *sd_fmts[ARRAY_SIZE(dcmi_formats)];
  1643		unsigned int num_fmts = 0, i, j;
  1644		struct v4l2_subdev *subdev = dcmi->source;
  1645		struct v4l2_subdev_mbus_code_enum mbus_code = {
  1646			.which = V4L2_SUBDEV_FORMAT_ACTIVE,
  1647		};
  1648	
  1649		while (!v4l2_subdev_call(subdev, pad, enum_mbus_code,
  1650					 NULL, &mbus_code)) {
  1651			for (i = 0; i < ARRAY_SIZE(dcmi_formats); i++) {
  1652				if (dcmi_formats[i].mbus_code != mbus_code.code)
  1653					continue;
  1654	
  1655				/* Exclude JPEG if BT656 bus is selected */
  1656				if (dcmi_formats[i].fourcc == V4L2_PIX_FMT_JPEG &&
  1657				    dcmi->bus_type == V4L2_MBUS_BT656)
  1658					continue;
  1659	
  1660				/* Code supported, have we got this fourcc yet? */
  1661				for (j = 0; j < num_fmts; j++)
  1662					if (sd_fmts[j]->fourcc ==
  1663							dcmi_formats[i].fourcc) {
  1664						/* Already available */
  1665						dev_dbg(dcmi->dev, "Skipping fourcc/code: %4.4s/0x%x\n",
  1666							(char *)&sd_fmts[j]->fourcc,
  1667							mbus_code.code);
  1668						break;
  1669					}
  1670				if (j == num_fmts) {
  1671					/* New */
  1672					sd_fmts[num_fmts++] = dcmi_formats + i;
  1673					dev_dbg(dcmi->dev, "Supported fourcc/code: %4.4s/0x%x\n",
  1674						(char *)&sd_fmts[num_fmts - 1]->fourcc,
  1675						sd_fmts[num_fmts - 1]->mbus_code);
  1676				}
  1677			}
  1678			mbus_code.index++;
  1679		}
  1680	
  1681		if (!num_fmts)
  1682			return -ENXIO;
  1683	
  1684		dcmi->num_of_sd_formats = num_fmts;
> 1685		dcmi->sd_formats = devm_kmemdup_array(dcmi->dev, sd_fmts, num_fmts,
  1686						      sizeof(sd_fmts[0]), GFP_KERNEL);
  1687		if (!dcmi->sd_formats) {
  1688			dev_err(dcmi->dev, "Could not allocate memory\n");
  1689			return -ENOMEM;
  1690		}
  1691	
  1692		dcmi->sd_format = dcmi->sd_formats[0];
  1693		return 0;
  1694	}
  1695	

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




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux