From: Jens Axboe <axboe@kernel.dk>
To: Geert Uytterhoeven <geert@linux-m68k.org>,
kernel test robot <lkp@intel.com>
Cc: Kanchan Joshi <joshi.k@samsung.com>,
kbuild-all@lists.01.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Anuj Gupta <anuj20.g@samsung.com>
Subject: Re: [axboe-block:nvme-passthru-wip 10/19] drivers/nvme/host/ioctl.c:47:19: error: cast to pointer from integer of different size
Date: Fri, 8 Oct 2021 06:35:02 -0600 [thread overview]
Message-ID: <c2115b49-f0ae-3c38-464b-5f99a572e681@kernel.dk> (raw)
In-Reply-To: <CAMuHMdUoh0PbLDU1_Drce=cQorv6M47i4pLDE9DtSOmsYOD9AQ@mail.gmail.com>
On 10/8/21 2:19 AM, Geert Uytterhoeven wrote:
> On Fri, Oct 8, 2021 at 12:12 AM kernel test robot <lkp@intel.com> wrote:
>> tree: https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git nvme-passthru-wip
>> head: 9c18980ac90053bcdb21594eae48935d89bf389c
>> commit: 5cc445dd8df6e06f3482711aa590170450364393 [10/19] nvme: wire-up support for async-passthru on char-device.
>> config: m68k-allmodconfig (attached as .config)
>> compiler: m68k-linux-gcc (GCC) 11.2.0
>> reproduce (this is a W=1 build):
>> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>> chmod +x ~/bin/make.cross
>> # https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git/commit/?id=5cc445dd8df6e06f3482711aa590170450364393
>> git remote add axboe-block https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git
>> git fetch --no-tags axboe-block nvme-passthru-wip
>> git checkout 5cc445dd8df6e06f3482711aa590170450364393
>> # save the attached .config to linux build tree
>> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=m68k
>>
>> If you fix the issue, kindly add following tag as appropriate
>> Reported-by: kernel test robot <lkp@intel.com>
>>
>> All errors (new ones prefixed by >>):
>>
>> drivers/nvme/host/ioctl.c: In function 'nvme_pt_task_cb':
>>>> drivers/nvme/host/ioctl.c:47:19: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
>> 47 | ptcmd64 = (void __user *) bcmd->unused2[0];
>> | ^
>> drivers/nvme/host/ioctl.c:62:58: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
>> 62 | struct nvme_passthru_cmd __user *ptcmd = (void *)bcmd->unused2[0];
>> | ^
>> drivers/nvme/host/ioctl.c: In function 'nvme_ns_async_ioctl':
>> drivers/nvme/host/ioctl.c:472:29: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
>> 472 | void __user *argp = (void __user *) bcmd->unused2[0];
>> | ^
>> cc1: all warnings being treated as errors
>>
>>
>> vim +47 drivers/nvme/host/ioctl.c
>>
>> 39
>> 40 static void nvme_pt_task_cb(struct io_uring_cmd *ioucmd)
>> 41 {
>> 42 struct uring_cmd_data *ucd;
>> 43 struct nvme_passthru_cmd64 __user *ptcmd64 = NULL;
>> 44 struct block_uring_cmd *bcmd;
>> 45
>> 46 bcmd = (struct block_uring_cmd *) &ioucmd->pdu;
>> > 47 ptcmd64 = (void __user *) bcmd->unused2[0];
>
> Casts from u64 to a pointer on 32-bit need an intermediate cast to uintptr_t:
>
> ptcmd64 = (void __user *)(uintptr_t)bcmd->unused2[0];
>
> Note that you can improve on the naming, as people may be surprised
> discovering "unused2" is actually used ;-)
There's a reason the branch is called -wip, it's just a hodge podge of
stuff. Not sure why the kernel test robot bothers reporting failures
publicly for that...
--
Jens Axboe
next prev parent reply other threads:[~2021-10-08 12:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-07 20:50 kernel test robot
2021-10-08 8:19 ` Geert Uytterhoeven
2021-10-08 12:35 ` Jens Axboe [this message]
2021-10-13 5:24 ` [kbuild-all] " Chen, Rong A
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=c2115b49-f0ae-3c38-464b-5f99a572e681@kernel.dk \
--to=axboe@kernel.dk \
--cc=anuj20.g@samsung.com \
--cc=geert@linux-m68k.org \
--cc=joshi.k@samsung.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
/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
all inboxes | Powered by JetHome®