Re: [PATCH 03/10] staging: kpc2000: remove fileops.c file.

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

 



Hi Greg,

I love your patch! Yet something to improve:

[auto build test ERROR on staging/staging-testing]
[cannot apply to v5.1 next-20190517]
[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/Greg-Kroah-Hartman/staging-kpc2000-fix-a-bunch-of-orginization-and-header-file-issues/20190517-213909
config: riscv-allyesconfig (attached as .config)
compiler: riscv64-linux-gcc (GCC) 8.1.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=8.1.0 make.cross ARCH=riscv 

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

All errors (new ones prefixed by >>):

   drivers/staging//kpc2000/kpc2000/core.c: In function 'kp2000_cdev_read':
>> drivers/staging//kpc2000/kpc2000/core.c:253:8: error: implicit declaration of function 'copy_to_user'; did you mean 'cpu_to_mem'? [-Werror=implicit-function-declaration]
     ret = copy_to_user(buf, buff + *f_pos, count);
           ^~~~~~~~~~~~
           cpu_to_mem
   cc1: some warnings being treated as errors

vim +253 drivers/staging//kpc2000/kpc2000/core.c

   219	
   220	
   221	static ssize_t kp2000_cdev_read(struct file *filp, char __user *buf,
   222					size_t count, loff_t *f_pos)
   223	{
   224		struct kp2000_device *pcard = filp->private_data;
   225		int cnt = 0;
   226		int ret;
   227	#define BUFF_CNT  1024
   228		char buff[BUFF_CNT] = {0}; //NOTE: Increase this so it is at least as large as all the scnprintfs.  And don't use unbounded strings. "%s"
   229		//NOTE: also, this is a really shitty way to implement the read() call, but it will work for any size 'count'.
   230	
   231		if (WARN(NULL == buf, "kp2000_cdev_read: buf is a NULL pointer!\n"))
   232			return -EINVAL;
   233	
   234		cnt += scnprintf(buff+cnt, BUFF_CNT-cnt, "Card ID                 : 0x%08x\n", pcard->card_id);
   235		cnt += scnprintf(buff+cnt, BUFF_CNT-cnt, "Build Version           : 0x%08x\n", pcard->build_version);
   236		cnt += scnprintf(buff+cnt, BUFF_CNT-cnt, "Build Date              : 0x%08x\n", pcard->build_datestamp);
   237		cnt += scnprintf(buff+cnt, BUFF_CNT-cnt, "Build Time              : 0x%08x\n", pcard->build_timestamp);
   238		cnt += scnprintf(buff+cnt, BUFF_CNT-cnt, "Core Table Offset       : 0x%08x\n", pcard->core_table_offset);
   239		cnt += scnprintf(buff+cnt, BUFF_CNT-cnt, "Core Table Length       : 0x%08x\n", pcard->core_table_length);
   240		cnt += scnprintf(buff+cnt, BUFF_CNT-cnt, "Hardware Revision       : 0x%08x\n", pcard->hardware_revision);
   241		cnt += scnprintf(buff+cnt, BUFF_CNT-cnt, "SSID                    : 0x%016llx\n", pcard->ssid);
   242		cnt += scnprintf(buff+cnt, BUFF_CNT-cnt, "DDNA                    : 0x%016llx\n", pcard->ddna);
   243		cnt += scnprintf(buff+cnt, BUFF_CNT-cnt, "IRQ Mask                : 0x%016llx\n", readq(pcard->sysinfo_regs_base + REG_INTERRUPT_MASK));
   244		cnt += scnprintf(buff+cnt, BUFF_CNT-cnt, "IRQ Active              : 0x%016llx\n", readq(pcard->sysinfo_regs_base + REG_INTERRUPT_ACTIVE));
   245		cnt += scnprintf(buff+cnt, BUFF_CNT-cnt, "CPLD                    : 0x%016llx\n", readq(pcard->sysinfo_regs_base + REG_CPLD_CONFIG));
   246	
   247		if (*f_pos >= cnt)
   248			return 0;
   249	
   250		if (count > cnt)
   251			count = cnt;
   252	
 > 253		ret = copy_to_user(buf, buff + *f_pos, count);
   254		if (ret)
   255			return -EFAULT;
   256		*f_pos += count;
   257		return count;
   258	}
   259	

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