From: kernel test robot <lkp@intel.com>
To: "Arnd, Bergmann," <arnd@arndb.de>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
Ben Hutchings <bwh@kernel.org>
Subject: drivers/scsi/sg.c:425:32: sparse: sparse: incorrect type in argument 1 (different address spaces)
Date: Wed, 3 Jun 2020 23:24:31 +0800 [thread overview]
Message-ID: <202006032328.hPsDSdlS%lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 10155 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: d6f9469a03d832dcd17041ed67774ffb5f3e73b3
commit: 78ed001d9e7106171e0ee761cd854137dd731302 compat: scsi: sg: fix v3 compat read/write interface
date: 5 months ago
config: sh-randconfig-s031-20200603 (attached as .config)
compiler: sh4-linux-gcc (GCC) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.1-244-g0ee050a8-dirty
git checkout 78ed001d9e7106171e0ee761cd854137dd731302
# save the attached .config to linux build tree
make W=1 C=1 ARCH=sh CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
sparse warnings: (new ones prefixed by >>)
./arch/sh/include/generated/uapi/asm/unistd_32.h:409:37: sparse: sparse: no newline at end of file
drivers/scsi/sg.c:415:21: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int const *__gu_addr @@ got int [noderef] <asn:1> * @@
drivers/scsi/sg.c:415:21: sparse: expected int const *__gu_addr
drivers/scsi/sg.c:415:21: sparse: got int [noderef] <asn:1> *
drivers/scsi/sg.c:415:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] <asn:1> * @@ got int const *__gu_addr @@
drivers/scsi/sg.c:415:21: sparse: expected void const volatile [noderef] <asn:1> *
drivers/scsi/sg.c:415:21: sparse: got int const *__gu_addr
drivers/scsi/sg.c:419:32: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int const *__gu_addr @@ got int [noderef] <asn:1> * @@
drivers/scsi/sg.c:419:32: sparse: expected int const *__gu_addr
drivers/scsi/sg.c:419:32: sparse: got int [noderef] <asn:1> *
drivers/scsi/sg.c:419:32: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] <asn:1> * @@ got int const *__gu_addr @@
drivers/scsi/sg.c:419:32: sparse: expected void const volatile [noderef] <asn:1> *
drivers/scsi/sg.c:419:32: sparse: got int const *__gu_addr
drivers/scsi/sg.c:425:32: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected signed int const *__gu_addr @@ got signed int [noderef] <asn:1> * @@
drivers/scsi/sg.c:425:32: sparse: expected signed int const *__gu_addr
drivers/scsi/sg.c:425:32: sparse: got signed int [noderef] <asn:1> *
>> drivers/scsi/sg.c:425:32: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] <asn:1> * @@ got signed int const *__gu_addr @@
drivers/scsi/sg.c:425:32: sparse: expected void const volatile [noderef] <asn:1> *
drivers/scsi/sg.c:425:32: sparse: got signed int const *__gu_addr
drivers/scsi/sg.c:431:32: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int const *__gu_addr @@ got int [noderef] <asn:1> * @@
drivers/scsi/sg.c:431:32: sparse: expected int const *__gu_addr
drivers/scsi/sg.c:431:32: sparse: got int [noderef] <asn:1> *
drivers/scsi/sg.c:431:32: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] <asn:1> * @@ got int const *__gu_addr @@
drivers/scsi/sg.c:431:32: sparse: expected void const volatile [noderef] <asn:1> *
drivers/scsi/sg.c:431:32: sparse: got int const *__gu_addr
drivers/scsi/sg.c:638:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected char const *__gu_addr @@ got char const [noderef] <asn:1> *[assigned] buf @@
drivers/scsi/sg.c:638:13: sparse: expected char const *__gu_addr
drivers/scsi/sg.c:638:13: sparse: got char const [noderef] <asn:1> *[assigned] buf
drivers/scsi/sg.c:638:13: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] <asn:1> * @@ got char const *__gu_addr @@
drivers/scsi/sg.c:638:13: sparse: expected void const volatile [noderef] <asn:1> *
drivers/scsi/sg.c:638:13: sparse: got char const *__gu_addr
drivers/scsi/sg.c:956:26: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int const *__gu_addr @@ got int [noderef] <asn:1> *ip @@
drivers/scsi/sg.c:956:26: sparse: expected int const *__gu_addr
drivers/scsi/sg.c:956:26: sparse: got int [noderef] <asn:1> *ip
drivers/scsi/sg.c:956:26: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] <asn:1> * @@ got int const *__gu_addr @@
drivers/scsi/sg.c:956:26: sparse: expected void const volatile [noderef] <asn:1> *
drivers/scsi/sg.c:956:26: sparse: got int const *__gu_addr
drivers/scsi/sg.c:999:26: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int const *__gu_addr @@ got int [noderef] <asn:1> *ip @@
drivers/scsi/sg.c:999:26: sparse: expected int const *__gu_addr
drivers/scsi/sg.c:999:26: sparse: got int [noderef] <asn:1> *ip
drivers/scsi/sg.c:999:26: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] <asn:1> * @@ got int const *__gu_addr @@
drivers/scsi/sg.c:999:26: sparse: expected void const volatile [noderef] <asn:1> *
drivers/scsi/sg.c:999:26: sparse: got int const *__gu_addr
drivers/scsi/sg.c:1027:26: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int const *__gu_addr @@ got int [noderef] <asn:1> *ip @@
drivers/scsi/sg.c:1027:26: sparse: expected int const *__gu_addr
drivers/scsi/sg.c:1027:26: sparse: got int [noderef] <asn:1> *ip
drivers/scsi/sg.c:1027:26: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] <asn:1> * @@ got int const *__gu_addr @@
drivers/scsi/sg.c:1027:26: sparse: expected void const volatile [noderef] <asn:1> *
drivers/scsi/sg.c:1027:26: sparse: got int const *__gu_addr
drivers/scsi/sg.c:1052:26: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int const *__gu_addr @@ got int [noderef] <asn:1> *ip @@
drivers/scsi/sg.c:1052:26: sparse: expected int const *__gu_addr
drivers/scsi/sg.c:1052:26: sparse: got int [noderef] <asn:1> *ip
drivers/scsi/sg.c:1052:26: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] <asn:1> * @@ got int const *__gu_addr @@
drivers/scsi/sg.c:1052:26: sparse: expected void const volatile [noderef] <asn:1> *
drivers/scsi/sg.c:1052:26: sparse: got int const *__gu_addr
drivers/scsi/sg.c:1060:26: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int const *__gu_addr @@ got int [noderef] <asn:1> *ip @@
drivers/scsi/sg.c:1060:26: sparse: expected int const *__gu_addr
drivers/scsi/sg.c:1060:26: sparse: got int [noderef] <asn:1> *ip
drivers/scsi/sg.c:1060:26: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] <asn:1> * @@ got int const *__gu_addr @@
drivers/scsi/sg.c:1060:26: sparse: expected void const volatile [noderef] <asn:1> *
drivers/scsi/sg.c:1060:26: sparse: got int const *__gu_addr
drivers/scsi/sg.c:1068:26: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int const *__gu_addr @@ got int [noderef] <asn:1> *ip @@
drivers/scsi/sg.c:1068:26: sparse: expected int const *__gu_addr
drivers/scsi/sg.c:1068:26: sparse: got int [noderef] <asn:1> *ip
drivers/scsi/sg.c:1068:26: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] <asn:1> * @@ got int const *__gu_addr @@
drivers/scsi/sg.c:1068:26: sparse: expected void const volatile [noderef] <asn:1> *
drivers/scsi/sg.c:1068:26: sparse: got int const *__gu_addr
drivers/scsi/sg.c:1112:26: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int const *__gu_addr @@ got int [noderef] <asn:1> *ip @@
drivers/scsi/sg.c:1112:26: sparse: expected int const *__gu_addr
drivers/scsi/sg.c:1112:26: sparse: got int [noderef] <asn:1> *ip
drivers/scsi/sg.c:1112:26: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] <asn:1> * @@ got int const *__gu_addr @@
drivers/scsi/sg.c:1112:26: sparse: expected void const volatile [noderef] <asn:1> *
drivers/scsi/sg.c:1112:26: sparse: got int const *__gu_addr
vim +425 drivers/scsi/sg.c
407
408 static int get_sg_io_pack_id(int *pack_id, void __user *buf, size_t count)
409 {
410 struct sg_header __user *old_hdr = buf;
411 int reply_len;
412
413 if (count >= SZ_SG_HEADER) {
414 /* negative reply_len means v3 format, otherwise v1/v2 */
415 if (get_user(reply_len, &old_hdr->reply_len))
416 return -EFAULT;
417
418 if (reply_len >= 0)
419 return get_user(*pack_id, &old_hdr->pack_id);
420
421 if (in_compat_syscall() &&
422 count >= sizeof(struct compat_sg_io_hdr)) {
423 struct compat_sg_io_hdr __user *hp = buf;
424
> 425 return get_user(*pack_id, &hp->pack_id);
426 }
427
428 if (count >= sizeof(struct sg_io_hdr)) {
429 struct sg_io_hdr __user *hp = buf;
430
431 return get_user(*pack_id, &hp->pack_id);
432 }
433 }
434
435 /* no valid header was passed, so ignore the pack_id */
436 *pack_id = -1;
437 return 0;
438 }
439
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 22065 bytes --]
reply other threads:[~2020-06-03 15:47 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202006032328.hPsDSdlS%lkp@intel.com \
--to=lkp@intel.com \
--cc=arnd@arndb.de \
--cc=bwh@kernel.org \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox