[PATCH v2] gpu: drm: gma500: Change return type to vm_fault_t

kbuild test robot lkp at intel.com
Sat May 26 02:41:38 UTC 2018


Hi Souptick,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on drm/drm-next]
[also build test WARNING on v4.17-rc6]
[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/Souptick-Joarder/gpu-drm-gma500-Change-return-type-to-vm_fault_t/20180526-084629
base:   git://people.freedesktop.org/~airlied/linux.git drm-next
config: x86_64-randconfig-x013-201820 (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=x86_64 

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/gpu//drm/gma500/framebuffer.c: In function 'psbfb_vm_fault':
>> drivers/gpu//drm/gma500/framebuffer.c:143:9: warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized]
     return ret;
            ^~~

vim +/ret +143 drivers/gpu//drm/gma500/framebuffer.c

   113	
   114	static vm_fault_t psbfb_vm_fault(struct vm_fault *vmf)
   115	{
   116		struct vm_area_struct *vma = vmf->vma;
   117		struct psb_framebuffer *psbfb = vma->vm_private_data;
   118		struct drm_device *dev = psbfb->base.dev;
   119		struct drm_psb_private *dev_priv = dev->dev_private;
   120		int page_num;
   121		int i;
   122		unsigned long address;
   123		vm_fault_t ret;
   124		unsigned long pfn;
   125		unsigned long phys_addr = (unsigned long)dev_priv->stolen_base +
   126					  psbfb->gtt->offset;
   127	
   128		page_num = vma_pages(vma);
   129		address = vmf->address - (vmf->pgoff << PAGE_SHIFT);
   130	
   131		vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
   132	
   133		for (i = 0; i < page_num; i++) {
   134			pfn = (phys_addr >> PAGE_SHIFT);
   135	
   136			ret = vmf_insert_mixed(vma, address,
   137					__pfn_to_pfn_t(pfn, PFN_DEV));
   138			if (unlikely(ret & VM_FAULT_ERROR))
   139				break;
   140			address += PAGE_SIZE;
   141			phys_addr += PAGE_SIZE;
   142		}
 > 143		return ret;
   144	}
   145	

---
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: 33960 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20180526/e6535050/attachment-0001.gz>


More information about the dri-devel mailing list