Re: [PATCH 3/3] media: imx: fix media bus format enumeration

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

 



Hi Philipp,

I love your patch! Perhaps something to improve:

[auto build test WARNING on linuxtv-media/master]
[cannot apply to v5.3-rc8 next-20190904]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Philipp-Zabel/media-imx-enable-V4L2_PIX_FMT_XBGR32-_BGRX32-and-_RGBX32/20190914-085415
base:   git://linuxtv.org/media_tree.git master
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 7.4.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.4.0 make.cross ARCH=ia64 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@xxxxxxxxx>

Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings

All warnings (new ones prefixed by >>):

   drivers/staging/media/imx/imx-media-utils.c: In function 'find_format':
   drivers/staging/media/imx/imx-media-utils.c:232:40: warning: comparison between 'const enum ipu_color_space' and 'enum codespace_sel' [-Wenum-compare]
      if ((cs_sel != CS_SEL_ANY && fmt->cs != cs_sel) ||
                                           ^~
   drivers/staging/media/imx/imx-media-utils.c: In function 'enum_format':
   drivers/staging/media/imx/imx-media-utils.c:262:40: warning: comparison between 'const enum ipu_color_space' and 'enum codespace_sel' [-Wenum-compare]
      if ((cs_sel != CS_SEL_ANY && fmt->cs != cs_sel) ||
                                           ^~
>> drivers/staging/media/imx/imx-media-utils.c:257:18: warning: 'j' may be used uninitialized in this function [-Wmaybe-uninitialized]
     unsigned int i, j, k = 0;
                     ^

vim +/j +257 drivers/staging/media/imx/imx-media-utils.c

   218	
   219	static const
   220	struct imx_media_pixfmt *find_format(u32 fourcc,
   221					     u32 code,
   222					     enum codespace_sel cs_sel,
   223					     bool allow_non_mbus,
   224					     bool allow_bayer)
   225	{
   226		const struct imx_media_pixfmt *fmt;
   227		int i, j;
   228	
   229		for (i = 0; i < ARRAY_SIZE(pixel_formats); i++) {
   230			fmt = &pixel_formats[i];
   231	
 > 232			if ((cs_sel != CS_SEL_ANY && fmt->cs != cs_sel) ||
   233			    (!allow_non_mbus && !fmt->codes[0]) ||
   234			    (!allow_bayer && fmt->bayer))
   235				continue;
   236	
   237			if (fourcc && fmt->fourcc == fourcc)
   238				return fmt;
   239	
   240			if (!code)
   241				continue;
   242	
   243			for (j = 0; j < ARRAY_SIZE(fmt->codes) && fmt->codes[j]; j++) {
   244				if (code == fmt->codes[j])
   245					return fmt;
   246			}
   247		}
   248		return NULL;
   249	}
   250	
   251	static int enum_format(u32 *fourcc, u32 *code, u32 index,
   252			       enum codespace_sel cs_sel,
   253			       bool allow_non_mbus,
   254			       bool allow_bayer)
   255	{
   256		const struct imx_media_pixfmt *fmt;
 > 257		unsigned int i, j, k = 0;
   258	
   259		for (i = 0; i < ARRAY_SIZE(pixel_formats); i++) {
   260			fmt = &pixel_formats[i];
   261	
   262			if ((cs_sel != CS_SEL_ANY && fmt->cs != cs_sel) ||
   263			    (!allow_non_mbus && !fmt->codes[0]) ||
   264			    (!allow_bayer && fmt->bayer))
   265				continue;
   266	
   267			if (fourcc && index == k)
   268				break;
   269	
   270			if (!code) {
   271				k++;
   272				continue;
   273			}
   274	
   275			for (j = 0; j < ARRAY_SIZE(fmt->codes) && fmt->codes[j]; j++) {
   276				if (index == k)
   277					goto out;
   278	
   279				k++;
   280			}
   281		}
   282		if (i == ARRAY_SIZE(pixel_formats))
   283			return -EINVAL;
   284	
   285	out:
   286		if (fourcc)
   287			*fourcc = fmt->fourcc;
   288		if (code)
   289			*code = fmt->codes[j];
   290	
   291		return 0;
   292	}
   293	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip


[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