[PATCH v2] staging: android: ion: Replace strncpy() for stracpy()
kbuild test robot
lkp at intel.com
Wed Sep 11 20:39:52 UTC 2019
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 at intel.com>
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 58680 bytes
Desc: not available
URL: <http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/attachments/20190912/dd52b2a6/attachment-0001.bin>
More information about the devel
mailing list