[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202103111031.2LEoY4rl-lkp@intel.com>
Date: Thu, 11 Mar 2021 10:49:00 +0800
From: kernel test robot <lkp@...el.com>
To: "Mirela Rabulea (OSS)" <mirela.rabulea@....nxp.com>,
mchehab@...nel.org, hverkuil-cisco@...all.nl, shawnguo@...nel.org,
robh+dt@...nel.org, p.zabel@...gutronix.de
Cc: kbuild-all@...ts.01.org, paul.kocialkowski@...tlin.com,
linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-imx@....com, s.hauer@...gutronix.de
Subject: Re: [PATCH v9 6/8] media: imx-jpeg: Add V4L2 driver for i.MX8 JPEG
Encoder/Decoder
Hi "Mirela,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on linuxtv-media/master]
[also build test WARNING on shawnguo/for-next robh/for-next linus/master v5.12-rc2 next-20210310]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Mirela-Rabulea-OSS/Add-V4L2-driver-for-i-MX8-JPEG-Encoder-Decoder/20210311-083324
base: git://linuxtv.org/media_tree.git master
config: microblaze-randconfig-r021-20210308 (attached as .config)
compiler: microblaze-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/c6db61a15ca1a173f200f4a2344b3198652d64a6
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Mirela-Rabulea-OSS/Add-V4L2-driver-for-i-MX8-JPEG-Encoder-Decoder/20210311-083324
git checkout c6db61a15ca1a173f200f4a2344b3198652d64a6
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=microblaze
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>
All warnings (new ones prefixed by >>):
drivers/media/platform/imx-jpeg/mxc-jpeg.c: In function 'mxc_jpeg_probe':
>> drivers/media/platform/imx-jpeg/mxc-jpeg.c:1967:14: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
1967 | mode = (int)(u64)of_id->data;
| ^
vim +1967 drivers/media/platform/imx-jpeg/mxc-jpeg.c
1954
1955 static int mxc_jpeg_probe(struct platform_device *pdev)
1956 {
1957 struct mxc_jpeg_dev *jpeg;
1958 struct device *dev = &pdev->dev;
1959 struct resource *res;
1960 int dec_irq;
1961 int ret;
1962 int mode;
1963 const struct of_device_id *of_id;
1964 unsigned int slot;
1965
1966 of_id = of_match_node(mxc_jpeg_match, dev->of_node);
> 1967 mode = (int)(u64)of_id->data;
1968
1969 jpeg = devm_kzalloc(dev, sizeof(struct mxc_jpeg_dev), GFP_KERNEL);
1970 if (!jpeg)
1971 return -ENOMEM;
1972
1973 mutex_init(&jpeg->lock);
1974 spin_lock_init(&jpeg->hw_lock);
1975
1976 ret = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(32));
1977 if (ret) {
1978 dev_err(&pdev->dev, "No suitable DMA available.\n");
1979 goto err_irq;
1980 }
1981
1982 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1983 jpeg->base_reg = devm_ioremap_resource(&pdev->dev, res);
1984 if (IS_ERR(jpeg->base_reg))
1985 return PTR_ERR(jpeg->base_reg);
1986
1987 for (slot = 0; slot < MXC_MAX_SLOTS; slot++) {
1988 dec_irq = platform_get_irq(pdev, slot);
1989 if (dec_irq < 0) {
1990 dev_err(&pdev->dev, "Failed to get irq %d\n", dec_irq);
1991 ret = dec_irq;
1992 goto err_irq;
1993 }
1994 ret = devm_request_irq(&pdev->dev, dec_irq, mxc_jpeg_dec_irq,
1995 0, pdev->name, jpeg);
1996 if (ret) {
1997 dev_err(&pdev->dev, "Failed to request irq %d (%d)\n",
1998 dec_irq, ret);
1999 goto err_irq;
2000 }
2001 }
2002
2003 jpeg->pdev = pdev;
2004 jpeg->dev = dev;
2005 jpeg->mode = mode;
2006
2007 ret = mxc_jpeg_attach_pm_domains(jpeg);
2008 if (ret < 0) {
2009 dev_err(dev, "failed to attach power domains %d\n", ret);
2010 return ret;
2011 }
2012
2013 /* v4l2 */
2014 ret = v4l2_device_register(dev, &jpeg->v4l2_dev);
2015 if (ret) {
2016 dev_err(dev, "failed to register v4l2 device\n");
2017 goto err_register;
2018 }
2019 jpeg->m2m_dev = v4l2_m2m_init(&mxc_jpeg_m2m_ops);
2020 if (IS_ERR(jpeg->m2m_dev)) {
2021 dev_err(dev, "failed to register v4l2 device\n");
2022 goto err_m2m;
2023 }
2024
2025 jpeg->dec_vdev = video_device_alloc();
2026 if (!jpeg->dec_vdev) {
2027 dev_err(dev, "failed to register v4l2 device\n");
2028 goto err_vdev_alloc;
2029 }
2030 if (mode == MXC_JPEG_ENCODE)
2031 snprintf(jpeg->dec_vdev->name,
2032 sizeof(jpeg->dec_vdev->name),
2033 "%s-enc", MXC_JPEG_NAME);
2034 else
2035 snprintf(jpeg->dec_vdev->name,
2036 sizeof(jpeg->dec_vdev->name),
2037 "%s-dec", MXC_JPEG_NAME);
2038
2039 jpeg->dec_vdev->fops = &mxc_jpeg_fops;
2040 jpeg->dec_vdev->ioctl_ops = &mxc_jpeg_ioctl_ops;
2041 jpeg->dec_vdev->minor = -1;
2042 jpeg->dec_vdev->release = video_device_release;
2043 jpeg->dec_vdev->lock = &jpeg->lock; /* lock for ioctl serialization */
2044 jpeg->dec_vdev->v4l2_dev = &jpeg->v4l2_dev;
2045 jpeg->dec_vdev->vfl_dir = VFL_DIR_M2M;
2046 jpeg->dec_vdev->device_caps = V4L2_CAP_STREAMING |
2047 V4L2_CAP_VIDEO_M2M_MPLANE;
2048 if (mode == MXC_JPEG_ENCODE) {
2049 v4l2_disable_ioctl(jpeg->dec_vdev, VIDIOC_DECODER_CMD);
2050 v4l2_disable_ioctl(jpeg->dec_vdev, VIDIOC_TRY_DECODER_CMD);
2051 } else {
2052 v4l2_disable_ioctl(jpeg->dec_vdev, VIDIOC_ENCODER_CMD);
2053 v4l2_disable_ioctl(jpeg->dec_vdev, VIDIOC_TRY_ENCODER_CMD);
2054 }
2055 ret = video_register_device(jpeg->dec_vdev, VFL_TYPE_VIDEO, -1);
2056 if (ret) {
2057 dev_err(dev, "failed to register video device\n");
2058 goto err_vdev_register;
2059 }
2060 video_set_drvdata(jpeg->dec_vdev, jpeg);
2061 if (mode == MXC_JPEG_ENCODE)
2062 v4l2_info(&jpeg->v4l2_dev,
2063 "encoder device registered as /dev/video%d (%d,%d)\n",
2064 jpeg->dec_vdev->num, VIDEO_MAJOR,
2065 jpeg->dec_vdev->minor);
2066 else
2067 v4l2_info(&jpeg->v4l2_dev,
2068 "decoder device registered as /dev/video%d (%d,%d)\n",
2069 jpeg->dec_vdev->num, VIDEO_MAJOR,
2070 jpeg->dec_vdev->minor);
2071
2072 platform_set_drvdata(pdev, jpeg);
2073
2074 return 0;
2075
2076 err_vdev_register:
2077 video_device_release(jpeg->dec_vdev);
2078
2079 err_vdev_alloc:
2080 v4l2_m2m_release(jpeg->m2m_dev);
2081
2082 err_m2m:
2083 v4l2_device_unregister(&jpeg->v4l2_dev);
2084
2085 err_register:
2086 err_irq:
2087 return ret;
2088 }
2089
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Download attachment ".config.gz" of type "application/gzip" (38839 bytes)
Powered by blists - more mailing lists