Re: [PATCH v2] staging: android: ion: Replace strncpy() for stracpy()

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

 



Hi Adam,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/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/Adam-Zerella/staging-android-ion-Replace-strncpy-for-stracpy/20190912-024431
config: sparc64-allmodconfig (attached as .config)
compiler: sparc64-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=sparc64 

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

All errors (new ones prefixed by >>):

   drivers/staging/android/ion/ion.c: In function 'ion_query_heaps':
>> drivers/staging/android/ion/ion.c:470:3: error: implicit declaration of function 'stracpy'; did you mean 'strscpy'? [-Werror=implicit-function-declaration]
      stracpy(hdata.name, heap->name);
      ^~~~~~~
      strscpy
   cc1: some warnings being treated as errors

vim +470 drivers/staging/android/ion/ion.c

   446	
   447	static int ion_query_heaps(struct ion_heap_query *query)
   448	{
   449		struct ion_device *dev = internal_dev;
   450		struct ion_heap_data __user *buffer = u64_to_user_ptr(query->heaps);
   451		int ret = -EINVAL, cnt = 0, max_cnt;
   452		struct ion_heap *heap;
   453		struct ion_heap_data hdata;
   454	
   455		memset(&hdata, 0, sizeof(hdata));
   456	
   457		down_read(&dev->lock);
   458		if (!buffer) {
   459			query->cnt = dev->heap_cnt;
   460			ret = 0;
   461			goto out;
   462		}
   463	
   464		if (query->cnt <= 0)
   465			goto out;
   466	
   467		max_cnt = query->cnt;
   468	
   469		plist_for_each_entry(heap, &dev->heaps, node) {
 > 470			stracpy(hdata.name, heap->name);
   471			hdata.type = heap->type;
   472			hdata.heap_id = heap->id;
   473	
   474			if (copy_to_user(&buffer[cnt], &hdata, sizeof(hdata))) {
   475				ret = -EFAULT;
   476				goto out;
   477			}
   478	
   479			cnt++;
   480			if (cnt >= max_cnt)
   481				break;
   482		}
   483	
   484		query->cnt = cnt;
   485		ret = 0;
   486	out:
   487		up_read(&dev->lock);
   488		return ret;
   489	}
   490	

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

Attachment: .config.gz
Description: application/gzip

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux