[xilinx-xlnx:xlnx_rebase_v5.10 240/1981] drivers/gpu/drm/xlnx/xlnx_mixer.c:1443:13: warning: cast from pointer to integer of different size

kernel test robot lkp at intel.com
Tue Dec 14 11:48:07 PST 2021


tree:   https://github.com/Xilinx/linux-xlnx xlnx_rebase_v5.10
head:   87ec9a2d98a7a7dfc98b57348a0ec310fd170e4b
commit: f44962ff80bcd41ca6c29caabecbf21fbc4f95a1 [240/1981] drm: xlnx: mixer: Initial video mixer driver
config: arc-allyesconfig (https://download.01.org/0day-ci/archive/20211215/202112150334.bpLUKdSA-lkp@intel.com/config)
compiler: arceb-elf-gcc (GCC) 11.2.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/Xilinx/linux-xlnx/commit/f44962ff80bcd41ca6c29caabecbf21fbc4f95a1
        git remote add xilinx-xlnx https://github.com/Xilinx/linux-xlnx
        git fetch --no-tags xilinx-xlnx xlnx_rebase_v5.10
        git checkout f44962ff80bcd41ca6c29caabecbf21fbc4f95a1
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arc SHELL=/bin/bash drivers/clk/ drivers/fpga/ drivers/gpu/drm/vc4/ drivers/gpu/drm/xlnx/ drivers/infiniband/hw/mlx5/ drivers/media/platform/xilinx/ drivers/memory/samsung/ drivers/misc/ drivers/mtd/nand/raw/brcmnand/ drivers/mtd/spi-nor/controllers/ drivers/net/ drivers/of/ drivers/ptp/ drivers/remoteproc/ drivers/spi/ drivers/staging/ drivers/thunderbolt/ drivers/uio/ drivers/usb/cdns3/ sound/hda/ sound/pci/hda/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp at intel.com>

All warnings (new ones prefixed by >>):

   drivers/gpu/drm/xlnx/xlnx_mixer.c: In function 'xlnx_mix_logo_load':
   drivers/gpu/drm/xlnx/xlnx_mixer.c:1339:20: warning: variable 'height' set but not used [-Wunused-but-set-variable]
    1339 |         u32 width, height, curr_x_pos, curr_y_pos;
         |                    ^~~~~~
   drivers/gpu/drm/xlnx/xlnx_mixer.c:1339:13: warning: variable 'width' set but not used [-Wunused-but-set-variable]
    1339 |         u32 width, height, curr_x_pos, curr_y_pos;
         |             ^~~~~
   drivers/gpu/drm/xlnx/xlnx_mixer.c: In function 'xlnx_mix_update_logo_img':
>> drivers/gpu/drm/xlnx/xlnx_mixer.c:1443:13: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    1443 |         if ((phys_addr_t)buffer->vaddr == logo_layer->layer_regs.buff_addr1 &&
         |             ^
   drivers/gpu/drm/xlnx/xlnx_mixer.c:1449:45: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    1449 |         logo_layer->layer_regs.buff_addr1 = (phys_addr_t)buffer->vaddr;
         |                                             ^
   drivers/gpu/drm/xlnx/xlnx_mixer.c:1397:13: warning: variable 'logo_cmp_cnt' set but not used [-Wunused-but-set-variable]
    1397 |         u32 logo_cmp_cnt;
         |             ^~~~~~~~~~~~
   drivers/gpu/drm/xlnx/xlnx_mixer.c: In function 'xlnx_mix_plane_create':
   drivers/gpu/drm/xlnx/xlnx_mixer.c:2049:42: warning: variable 'layer_data' set but not used [-Wunused-but-set-variable]
    2049 |         struct xlnx_mix_layer_data      *layer_data;
         |                                          ^~~~~~~~~~
   drivers/gpu/drm/xlnx/xlnx_mixer.c: In function 'xlnx_mix_crtc_create':
   drivers/gpu/drm/xlnx/xlnx_mixer.c:2418:27: warning: variable 'cursor_plane' set but not used [-Wunused-but-set-variable]
    2418 |         struct drm_plane *cursor_plane = NULL;
         |                           ^~~~~~~~~~~~
   drivers/gpu/drm/xlnx/xlnx_mixer.c:2417:27: warning: variable 'primary_plane' set but not used [-Wunused-but-set-variable]
    2417 |         struct drm_plane *primary_plane = NULL;
         |                           ^~~~~~~~~~~~~


vim +1443 drivers/gpu/drm/xlnx/xlnx_mixer.c

  1388	
  1389	static int xlnx_mix_update_logo_img(struct xlnx_mix_plane *plane,
  1390					    struct drm_gem_cma_object *buffer,
  1391					     u32 src_w, u32 src_h)
  1392	{
  1393		struct xlnx_mix_layer_data *logo_layer = plane->mixer_layer;
  1394		size_t pixel_cnt = src_h * src_w;
  1395		/* color comp defaults to offset in RG24 buffer */
  1396		u32 pix_cmp_cnt;
  1397		u32 logo_cmp_cnt;
  1398		bool per_pixel_alpha = false;
  1399		u32 max_width = logo_layer->hw_config.max_width;
  1400		u32 max_height = logo_layer->hw_config.max_height;
  1401		u32 min_width = logo_layer->hw_config.min_width;
  1402		u32 min_height = logo_layer->hw_config.min_height;
  1403		u8 *r_data = NULL;
  1404		u8 *g_data = NULL;
  1405		u8 *b_data = NULL;
  1406		u8 *a_data = NULL;
  1407		size_t el_size = sizeof(u8);
  1408		u8 *pixel_mem_data;
  1409		int ret, i, j;
  1410	
  1411		/* ensure valid conditions for update */
  1412		if (logo_layer->id != XVMIX_LAYER_LOGO)
  1413			return 0;
  1414	
  1415		if (src_h > max_height || src_w > max_width ||
  1416		    src_h < min_height || src_w < min_width) {
  1417			DRM_ERROR("Mixer logo/cursor layer dimensions illegal.\n");
  1418			return -EINVAL;
  1419		}
  1420	
  1421		if (!xlnx_mix_isfmt_support(plane->mixer_layer->hw_config.vid_fmt)) {
  1422			DRM_ERROR("DRM color format not supported for logo layer\n");
  1423			return -EINVAL;
  1424		}
  1425		per_pixel_alpha = (logo_layer->hw_config.vid_fmt ==
  1426				   DRM_FORMAT_RGBA8888) ? false : true;
  1427		r_data = kcalloc(pixel_cnt, el_size, GFP_KERNEL);
  1428		g_data = kcalloc(pixel_cnt, el_size, GFP_KERNEL);
  1429		b_data = kcalloc(pixel_cnt, el_size, GFP_KERNEL);
  1430		if (per_pixel_alpha)
  1431			a_data = kcalloc(pixel_cnt, el_size, GFP_KERNEL);
  1432	
  1433		if (!r_data || !g_data || !b_data || (per_pixel_alpha && !a_data)) {
  1434			DRM_ERROR("Unable to allocate memory for logo layer data\n");
  1435			ret = -ENOMEM;
  1436			goto free;
  1437		}
  1438		pix_cmp_cnt = per_pixel_alpha ? 4 : 3;
  1439		logo_cmp_cnt = pixel_cnt * pix_cmp_cnt;
  1440		/* ensure buffer attributes have changed to indicate new logo
  1441		 * has been created
  1442		 */
> 1443		if ((phys_addr_t)buffer->vaddr == logo_layer->layer_regs.buff_addr1 &&
  1444		    src_w == logo_layer->layer_regs.width &&
  1445		    src_h == logo_layer->layer_regs.height)
  1446			return 0;
  1447	
  1448		/* cache buffer address for future comparison */
  1449		logo_layer->layer_regs.buff_addr1 = (phys_addr_t)buffer->vaddr;
  1450		pixel_mem_data = (u8 *)(buffer->vaddr);
  1451		for (i = 0, j = 0; j < pixel_cnt; j++) {
  1452			if (per_pixel_alpha && a_data)
  1453				a_data[j] = pixel_mem_data[i++];
  1454	
  1455			b_data[j] = pixel_mem_data[i++];
  1456			g_data[j] = pixel_mem_data[i++];
  1457			r_data[j] = pixel_mem_data[i++];
  1458		}
  1459		ret = xlnx_mix_logo_load(to_mixer_hw(plane), src_w, src_h, r_data,
  1460					 g_data, b_data,
  1461					 per_pixel_alpha ? a_data : NULL);
  1462	free:
  1463		kfree(r_data);
  1464		kfree(g_data);
  1465		kfree(b_data);
  1466		kfree(a_data);
  1467	
  1468		return ret;
  1469	}
  1470	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org



More information about the linux-arm-kernel mailing list