[vfs:uaccess.powerpc 11/11] drivers/net//ethernet/ibm/ibmvnic.c:2826:2: warning: ignoring return value of 'copy_to_user', declared with attribute warn_unused_result

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

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git uaccess.powerpc
head:   49e54b17130e74849b76d10c240f2d7c9b4736bc
commit: 49e54b17130e74849b76d10c240f2d7c9b4736bc [11/11] powerpc: get rid of zeroing, switch to RAW_COPY_USER
config: powerpc-allmodconfig (attached as .config)
compiler: powerpc64-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
        wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout 49e54b17130e74849b76d10c240f2d7c9b4736bc
        # save the attached .config to linux build tree
        make.cross ARCH=powerpc 

All warnings (new ones prefixed by >>):

   drivers/net//ethernet/ibm/ibmvnic.c: In function 'trace_read':
>> drivers/net//ethernet/ibm/ibmvnic.c:2826:2: warning: ignoring return value of 'copy_to_user', declared with attribute warn_unused_result [-Wunused-result]
     copy_to_user(user_buf, &((u8 *)trace)[*ppos], len);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net//ethernet/ibm/ibmvnic.c: In function 'paused_write':
>> drivers/net//ethernet/ibm/ibmvnic.c:2870:2: warning: ignoring return value of 'copy_from_user', declared with attribute warn_unused_result [-Wunused-result]
     copy_from_user(buff, user_buf, sizeof(buff));
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net//ethernet/ibm/ibmvnic.c: In function 'paused_read':
   drivers/net//ethernet/ibm/ibmvnic.c:2855:2: warning: ignoring return value of 'copy_to_user', declared with attribute warn_unused_result [-Wunused-result]
     copy_to_user(user_buf, buff, size);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net//ethernet/ibm/ibmvnic.c: In function 'tracing_write':
   drivers/net//ethernet/ibm/ibmvnic.c:2921:2: warning: ignoring return value of 'copy_from_user', declared with attribute warn_unused_result [-Wunused-result]
     copy_from_user(buff, user_buf, sizeof(buff));
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net//ethernet/ibm/ibmvnic.c: In function 'tracing_read':
   drivers/net//ethernet/ibm/ibmvnic.c:2906:2: warning: ignoring return value of 'copy_to_user', declared with attribute warn_unused_result [-Wunused-result]
     copy_to_user(user_buf, buff, size);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net//ethernet/ibm/ibmvnic.c: In function 'trace_level_write':
   drivers/net//ethernet/ibm/ibmvnic.c:3020:2: warning: ignoring return value of 'copy_from_user', declared with attribute warn_unused_result [-Wunused-result]
     copy_from_user(buff, user_buf, sizeof(buff));
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net//ethernet/ibm/ibmvnic.c: In function 'trace_level_read':
   drivers/net//ethernet/ibm/ibmvnic.c:3006:2: warning: ignoring return value of 'copy_to_user', declared with attribute warn_unused_result [-Wunused-result]
     copy_to_user(user_buf, buff, size);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net//ethernet/ibm/ibmvnic.c: In function 'trace_buff_size_write':
   drivers/net//ethernet/ibm/ibmvnic.c:3072:2: warning: ignoring return value of 'copy_from_user', declared with attribute warn_unused_result [-Wunused-result]
     copy_from_user(buff, user_buf, sizeof(buff));
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net//ethernet/ibm/ibmvnic.c: In function 'trace_buff_size_read':
   drivers/net//ethernet/ibm/ibmvnic.c:3057:2: warning: ignoring return value of 'copy_to_user', declared with attribute warn_unused_result [-Wunused-result]
     copy_to_user(user_buf, buff, size);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

vim +/copy_to_user +2826 drivers/net//ethernet/ibm/ibmvnic.c

032c5e82 Thomas Falcon 2015-12-21  2820  
032c5e82 Thomas Falcon 2015-12-21  2821  	if (*ppos + len > be32_to_cpu(adapter->ras_comps[num].trace_buff_size))
032c5e82 Thomas Falcon 2015-12-21  2822  		len =
032c5e82 Thomas Falcon 2015-12-21  2823  		    be32_to_cpu(adapter->ras_comps[num].trace_buff_size) -
032c5e82 Thomas Falcon 2015-12-21  2824  		    *ppos;
032c5e82 Thomas Falcon 2015-12-21  2825  
032c5e82 Thomas Falcon 2015-12-21 @2826  	copy_to_user(user_buf, &((u8 *)trace)[*ppos], len);
032c5e82 Thomas Falcon 2015-12-21  2827  
032c5e82 Thomas Falcon 2015-12-21  2828  	dma_free_coherent(dev,
032c5e82 Thomas Falcon 2015-12-21  2829  			  be32_to_cpu(adapter->ras_comps[num].trace_buff_size),
032c5e82 Thomas Falcon 2015-12-21  2830  			  trace, trace_tok);
032c5e82 Thomas Falcon 2015-12-21  2831  	*ppos += len;
032c5e82 Thomas Falcon 2015-12-21  2832  	return len;
032c5e82 Thomas Falcon 2015-12-21  2833  }
032c5e82 Thomas Falcon 2015-12-21  2834  
032c5e82 Thomas Falcon 2015-12-21  2835  static const struct file_operations trace_ops = {
032c5e82 Thomas Falcon 2015-12-21  2836  	.owner		= THIS_MODULE,
7a95e94c Wei Yongjun   2016-08-24  2837  	.open		= simple_open,
032c5e82 Thomas Falcon 2015-12-21  2838  	.read		= trace_read,
032c5e82 Thomas Falcon 2015-12-21  2839  };
032c5e82 Thomas Falcon 2015-12-21  2840  
032c5e82 Thomas Falcon 2015-12-21  2841  static ssize_t paused_read(struct file *file, char __user *user_buf, size_t len,
032c5e82 Thomas Falcon 2015-12-21  2842  			   loff_t *ppos)
032c5e82 Thomas Falcon 2015-12-21  2843  {
032c5e82 Thomas Falcon 2015-12-21  2844  	struct ibmvnic_fw_comp_internal *ras_comp_int = file->private_data;
032c5e82 Thomas Falcon 2015-12-21  2845  	struct ibmvnic_adapter *adapter = ras_comp_int->adapter;
032c5e82 Thomas Falcon 2015-12-21  2846  	int num = ras_comp_int->num;
032c5e82 Thomas Falcon 2015-12-21  2847  	char buff[5]; /*  1 or 0 plus \n and \0 */
032c5e82 Thomas Falcon 2015-12-21  2848  	int size;
032c5e82 Thomas Falcon 2015-12-21  2849  
032c5e82 Thomas Falcon 2015-12-21  2850  	size = sprintf(buff, "%d\n", adapter->ras_comp_int[num].paused);
032c5e82 Thomas Falcon 2015-12-21  2851  
032c5e82 Thomas Falcon 2015-12-21  2852  	if (*ppos >= size)
032c5e82 Thomas Falcon 2015-12-21  2853  		return 0;
032c5e82 Thomas Falcon 2015-12-21  2854  
032c5e82 Thomas Falcon 2015-12-21  2855  	copy_to_user(user_buf, buff, size);
032c5e82 Thomas Falcon 2015-12-21  2856  	*ppos += size;
032c5e82 Thomas Falcon 2015-12-21  2857  	return size;
032c5e82 Thomas Falcon 2015-12-21  2858  }
032c5e82 Thomas Falcon 2015-12-21  2859  
032c5e82 Thomas Falcon 2015-12-21  2860  static ssize_t paused_write(struct file *file, const char __user *user_buf,
032c5e82 Thomas Falcon 2015-12-21  2861  			    size_t len, loff_t *ppos)
032c5e82 Thomas Falcon 2015-12-21  2862  {
032c5e82 Thomas Falcon 2015-12-21  2863  	struct ibmvnic_fw_comp_internal *ras_comp_int = file->private_data;
032c5e82 Thomas Falcon 2015-12-21  2864  	struct ibmvnic_adapter *adapter = ras_comp_int->adapter;
032c5e82 Thomas Falcon 2015-12-21  2865  	int num = ras_comp_int->num;
032c5e82 Thomas Falcon 2015-12-21  2866  	union ibmvnic_crq crq;
032c5e82 Thomas Falcon 2015-12-21  2867  	unsigned long val;
032c5e82 Thomas Falcon 2015-12-21  2868  	char buff[9]; /* decimal max int plus \n and \0 */
032c5e82 Thomas Falcon 2015-12-21  2869  
032c5e82 Thomas Falcon 2015-12-21 @2870  	copy_from_user(buff, user_buf, sizeof(buff));
032c5e82 Thomas Falcon 2015-12-21  2871  	val = kstrtoul(buff, 10, NULL);
032c5e82 Thomas Falcon 2015-12-21  2872  
032c5e82 Thomas Falcon 2015-12-21  2873  	adapter->ras_comp_int[num].paused = val ? 1 : 0;

:::::: The code at line 2826 was first introduced by commit
:::::: 032c5e82847a2214c3196a90f0aeba0ce252de58 Driver for IBM System i/p VNIC protocol

:::::: TO: Thomas Falcon <tlfalcon@xxxxxxxxxxxxxxxxxx>
:::::: CC: David S. Miller <davem@xxxxxxxxxxxxx>

---
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 Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux