[Intel-gfx] [PATCH v3 4/9] drm/cma-helper: Use the generic fbdev emulation

kbuild test robot lkp at intel.com
Wed Jun 27 14:47:13 UTC 2018


Hi Noralf,

I love your patch! Perhaps something to improve:

[auto build test WARNING on next-20180627]
[cannot apply to drm/drm-next linus/master drm-exynos/exynos-drm/for-next v4.18-rc2 v4.18-rc1 v4.17 v4.18-rc2]
[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/Noralf-Tr-nnes/drm-Add-generic-fbdev-emulation/20180627-222604
config: i386-randconfig-x018-201825 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-16) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

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 >>):

   Cyclomatic Complexity 1 arch/x86/include/asm/bitops.h:fls
   Cyclomatic Complexity 1 include/linux/log2.h:__ilog2_u32
   Cyclomatic Complexity 1 include/linux/err.h:ERR_PTR
   Cyclomatic Complexity 1 include/linux/err.h:PTR_ERR
   Cyclomatic Complexity 1 include/linux/err.h:IS_ERR
   Cyclomatic Complexity 1 include/asm-generic/getorder.h:__get_order
   Cyclomatic Complexity 28 include/linux/slab.h:kmalloc_index
   Cyclomatic Complexity 67 include/linux/slab.h:kmalloc_large
   Cyclomatic Complexity 5 include/linux/slab.h:kmalloc
   Cyclomatic Complexity 1 include/linux/slab.h:kzalloc
   Cyclomatic Complexity 2 drivers/gpu/drm/drm_fb_cma_helper.c:to_fbdev_cma
   Cyclomatic Complexity 3 drivers/gpu/drm/drm_fb_cma_helper.c:drm_fb_cma_get_gem_obj
   Cyclomatic Complexity 2 drivers/gpu/drm/drm_fb_cma_helper.c:drm_fb_cma_get_gem_addr
   Cyclomatic Complexity 4 drivers/gpu/drm/drm_fb_cma_helper.c:drm_fbdev_cma_init
   Cyclomatic Complexity 2 drivers/gpu/drm/drm_fb_cma_helper.c:drm_fb_cma_fbdev_init
   Cyclomatic Complexity 1 drivers/gpu/drm/drm_fb_cma_helper.c:drm_fb_cma_fbdev_init_with_funcs
   Cyclomatic Complexity 1 drivers/gpu/drm/drm_fb_cma_helper.c:drm_fbdev_cma_fini
   Cyclomatic Complexity 2 drivers/gpu/drm/drm_fb_cma_helper.c:drm_fb_cma_fbdev_fini
   Cyclomatic Complexity 2 drivers/gpu/drm/drm_fb_cma_helper.c:drm_fbdev_cma_restore_mode
   Cyclomatic Complexity 2 drivers/gpu/drm/drm_fb_cma_helper.c:drm_fbdev_cma_hotplug_event
   Cyclomatic Complexity 2 drivers/gpu/drm/drm_fb_cma_helper.c:drm_fbdev_cma_set_suspend
   Cyclomatic Complexity 2 drivers/gpu/drm/drm_fb_cma_helper.c:drm_fbdev_cma_set_suspend_unlocked
   drivers/gpu/drm/drm_fb_cma_helper.c: In function 'drm_fbdev_cma_init':
>> drivers/gpu/drm/drm_fb_cma_helper.c:197:2: warning: 'client' may be used uninitialized in this function [-Wmaybe-uninitialized]
     drm_client_release(client);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~

vim +/client +197 drivers/gpu/drm/drm_fb_cma_helper.c

   162	
   163	/**
   164	 * drm_fbdev_cma_init() - Allocate and initializes a drm_fbdev_cma struct
   165	 * @dev: DRM device
   166	 * @preferred_bpp: Preferred bits per pixel for the device
   167	 * @max_conn_count: Maximum number of connectors
   168	 *
   169	 * Returns a newly allocated drm_fbdev_cma struct or a ERR_PTR.
   170	 */
   171	struct drm_fbdev_cma *drm_fbdev_cma_init(struct drm_device *dev,
   172		unsigned int preferred_bpp, unsigned int max_conn_count)
   173	{
   174		struct drm_fbdev_cma *fbdev_cma;
   175		struct drm_fb_helper *fb_helper;
   176		struct drm_client_dev *client;
   177		int ret;
   178	
   179		fbdev_cma = kzalloc(sizeof(*fbdev_cma), GFP_KERNEL);
   180		if (!fbdev_cma)
   181			return ERR_PTR(-ENOMEM);
   182	
   183		fb_helper = &fbdev_cma->fb_helper;
   184	
   185		ret = drm_client_new(dev, &fb_helper->client, "fbdev");
   186		if (ret)
   187			goto err_free;
   188	
   189		ret = drm_fb_helper_fbdev_setup(dev, fb_helper, &drm_fb_cma_helper_funcs,
   190						preferred_bpp, max_conn_count);
   191		if (ret)
   192			goto err_client_put;
   193	
   194		return fbdev_cma;
   195	
   196	err_client_put:
 > 197		drm_client_release(client);
   198	err_free:
   199		kfree(fbdev_cma);
   200	
   201		return ERR_PTR(ret);
   202	}
   203	EXPORT_SYMBOL_GPL(drm_fbdev_cma_init);
   204	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 26413 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/intel-gfx/attachments/20180627/7d2d51f7/attachment-0001.gz>


More information about the Intel-gfx mailing list