[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202006280258.bU0INeqA%lkp@intel.com>
Date: Sun, 28 Jun 2020 02:54:01 +0800
From: kernel test robot <lkp@...el.com>
To: Luc Van Oostenryck <luc.vanoostenryck@...il.com>
Cc: kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org
Subject: drivers/scsi/qedi/qedi_debugfs.c:109:45: sparse: sparse: incorrect
type in argument 2 (different address spaces)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 4e99b32169e84b4ece5a1d74eb0b7e4ef07866b3
commit: 670d0a4b10704667765f7d18f7592993d02783aa sparse: use identifiers to define address spaces
date: 9 days ago
config: x86_64-randconfig-s021-20200628 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.2-dirty
git checkout 670d0a4b10704667765f7d18f7592993d02783aa
# save the attached .config to linux build tree
make W=1 C=1 ARCH=x86_64 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>
sparse warnings: (new ones prefixed by >>)
>> drivers/scsi/qedi/qedi_debugfs.c:109:45: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected char const * @@ got char const [noderef] __user *buffer @@
drivers/scsi/qedi/qedi_debugfs.c:109:45: sparse: expected char const *
>> drivers/scsi/qedi/qedi_debugfs.c:109:45: sparse: got char const [noderef] __user *buffer
>> drivers/scsi/qedi/qedi_debugfs.c:128:23: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected char *buf @@ got char [noderef] __user *buffer @@
drivers/scsi/qedi/qedi_debugfs.c:128:23: sparse: expected char *buf
>> drivers/scsi/qedi/qedi_debugfs.c:128:23: sparse: got char [noderef] __user *buffer
drivers/scsi/qedi/qedi_debugfs.c:154:41: sparse: sparse: restricted __le16 degrades to integer
vim +109 drivers/scsi/qedi/qedi_debugfs.c
ace7f46ba5fde7 Manish Rangankar 2016-12-01 92
ace7f46ba5fde7 Manish Rangankar 2016-12-01 93 static ssize_t
ace7f46ba5fde7 Manish Rangankar 2016-12-01 94 qedi_dbg_do_not_recover_cmd_write(struct file *filp, const char __user *buffer,
ace7f46ba5fde7 Manish Rangankar 2016-12-01 95 size_t count, loff_t *ppos)
ace7f46ba5fde7 Manish Rangankar 2016-12-01 96 {
ace7f46ba5fde7 Manish Rangankar 2016-12-01 97 size_t cnt = 0;
ace7f46ba5fde7 Manish Rangankar 2016-12-01 98 struct qedi_dbg_ctx *qedi_dbg =
ace7f46ba5fde7 Manish Rangankar 2016-12-01 99 (struct qedi_dbg_ctx *)filp->private_data;
ace7f46ba5fde7 Manish Rangankar 2016-12-01 100 struct qedi_list_of_funcs *lof = qedi_dbg_do_not_recover_ops;
ace7f46ba5fde7 Manish Rangankar 2016-12-01 101
ace7f46ba5fde7 Manish Rangankar 2016-12-01 102 if (*ppos)
ace7f46ba5fde7 Manish Rangankar 2016-12-01 103 return 0;
ace7f46ba5fde7 Manish Rangankar 2016-12-01 104
ace7f46ba5fde7 Manish Rangankar 2016-12-01 105 while (lof) {
ace7f46ba5fde7 Manish Rangankar 2016-12-01 106 if (!(lof->oper_str))
ace7f46ba5fde7 Manish Rangankar 2016-12-01 107 break;
ace7f46ba5fde7 Manish Rangankar 2016-12-01 108
ace7f46ba5fde7 Manish Rangankar 2016-12-01 @109 if (!strncmp(lof->oper_str, buffer, strlen(lof->oper_str))) {
ace7f46ba5fde7 Manish Rangankar 2016-12-01 110 cnt = lof->oper_func(qedi_dbg);
ace7f46ba5fde7 Manish Rangankar 2016-12-01 111 break;
ace7f46ba5fde7 Manish Rangankar 2016-12-01 112 }
ace7f46ba5fde7 Manish Rangankar 2016-12-01 113
ace7f46ba5fde7 Manish Rangankar 2016-12-01 114 lof++;
ace7f46ba5fde7 Manish Rangankar 2016-12-01 115 }
ace7f46ba5fde7 Manish Rangankar 2016-12-01 116 return (count - cnt);
ace7f46ba5fde7 Manish Rangankar 2016-12-01 117 }
ace7f46ba5fde7 Manish Rangankar 2016-12-01 118
ace7f46ba5fde7 Manish Rangankar 2016-12-01 119 static ssize_t
ace7f46ba5fde7 Manish Rangankar 2016-12-01 120 qedi_dbg_do_not_recover_cmd_read(struct file *filp, char __user *buffer,
ace7f46ba5fde7 Manish Rangankar 2016-12-01 121 size_t count, loff_t *ppos)
ace7f46ba5fde7 Manish Rangankar 2016-12-01 122 {
ace7f46ba5fde7 Manish Rangankar 2016-12-01 123 size_t cnt = 0;
ace7f46ba5fde7 Manish Rangankar 2016-12-01 124
ace7f46ba5fde7 Manish Rangankar 2016-12-01 125 if (*ppos)
ace7f46ba5fde7 Manish Rangankar 2016-12-01 126 return 0;
ace7f46ba5fde7 Manish Rangankar 2016-12-01 127
bd571195c9535c Arnd Bergmann 2017-03-02 @128 cnt = sprintf(buffer, "do_not_recover=%d\n", qedi_do_not_recover);
ace7f46ba5fde7 Manish Rangankar 2016-12-01 129 cnt = min_t(int, count, cnt - *ppos);
ace7f46ba5fde7 Manish Rangankar 2016-12-01 130 *ppos += cnt;
ace7f46ba5fde7 Manish Rangankar 2016-12-01 131 return cnt;
ace7f46ba5fde7 Manish Rangankar 2016-12-01 132 }
ace7f46ba5fde7 Manish Rangankar 2016-12-01 133
:::::: The code at line 109 was first introduced by commit
:::::: ace7f46ba5fde7273207c7122b0650ceb72510e0 scsi: qedi: Add QLogic FastLinQ offload iSCSI driver framework.
:::::: TO: Manish Rangankar <manish.rangankar@...ium.com>
:::::: CC: Martin K. Petersen <martin.petersen@...cle.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Download attachment ".config.gz" of type "application/gzip" (35427 bytes)
Powered by blists - more mailing lists