Re: [PATCH] usb: gadget: f_fs: Allow scatter-gather buffers

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

 



Hi Andrzej,

I love your patch! Yet something to improve:

[auto build test ERROR on balbi-usb/next]
[also build test ERROR on v4.20-rc1 next-20181109]
[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/Andrzej-Pietrasiewicz/usb-gadget-f_fs-Allow-scatter-gather-buffers/20181109-194916
base:   https://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git next
config: sparc64-allyesconfig (attached as .config)
compiler: sparc64-linux-gnu-gcc (Debian 7.2.0-11) 7.2.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.2.0 make.cross ARCH=sparc64 

All error/warnings (new ones prefixed by >>):

   drivers/usb/gadget/function/f_fs.c: In function 'ffs_build_sg_list':
>> drivers/usb/gadget/function/f_fs.c:769:10: error: implicit declaration of function 'vmalloc'; did you mean 'kvmalloc'? [-Werror=implicit-function-declaration]
     vaddr = vmalloc(size);
             ^~~~~~~
             kvmalloc
>> drivers/usb/gadget/function/f_fs.c:769:8: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     vaddr = vmalloc(size);
           ^
>> drivers/usb/gadget/function/f_fs.c:778:3: error: implicit declaration of function 'vfree'; did you mean 'kvfree'? [-Werror=implicit-function-declaration]
      vfree(vaddr);
      ^~~~~
      kvfree
   cc1: some warnings being treated as errors

vim +769 drivers/usb/gadget/function/f_fs.c

   755	
   756	/*
   757	 * allocate a virtually contiguous buffer and create a scatterlist describing it
   758	 * @sg_table	- pointer to a place to be filled with sg_table contents
   759	 * @size	- required buffer size
   760	 */
   761	static void *ffs_build_sg_list(struct sg_table *sg_table, size_t size)
   762	{
   763		struct page **pages;
   764		void *vaddr;
   765		unsigned long ptr;
   766		unsigned int n_pages;
   767		int i;
   768	
 > 769		vaddr = vmalloc(size);
   770		if (!vaddr)
   771			return NULL;
   772	
   773		n_pages =  (PAGE_ALIGN((unsigned long)vaddr + size) -
   774			((unsigned long)vaddr & PAGE_MASK))
   775			>> PAGE_SHIFT;
   776		pages = kvmalloc_array(n_pages, sizeof(struct page *), GFP_KERNEL);
   777		if (!pages) {
 > 778			vfree(vaddr);
   779	
   780			return NULL;
   781		}
   782		for (i = 0, ptr = (unsigned long)vaddr & PAGE_MASK; i < n_pages;
   783			++i, ptr += PAGE_SIZE)
   784			pages[i] = vmalloc_to_page((void *)ptr);
   785	
   786		if (sg_alloc_table_from_pages(sg_table, pages, n_pages,
   787			((unsigned long)vaddr) & ~PAGE_MASK, size, GFP_KERNEL)) {
   788			kvfree(pages);
   789			vfree(vaddr);
   790	
   791			return NULL;
   792		}
   793		kvfree(pages);
   794	
   795		return vaddr;
   796	}
   797	

---
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 Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux