From: Christoph Hellwig <hch@lst.de>
To: Breno Leitao <leitao@debian.org>
Cc: Christoph Hellwig <hch@lst.de>,
io-uring@vger.kernel.org, linux-nvme@lists.infradead.org,
asml.silence@gmail.com, axboe@kernel.dk, leit@fb.com,
linux-kernel@vger.kernel.org, linux-block@vger.kernel.org,
sagi@grimberg.me, kbusch@kernel.org, ming.lei@redhat.com
Subject: Re: [PATCH 1/2] io_uring: Pass whole sqe to commands
Date: Mon, 24 Apr 2023 07:08:43 +0200 [thread overview]
Message-ID: <20230424050843.GA9252@lst.de> (raw)
In-Reply-To: <ZEKno++WWPauufw0@gmail.com>
On Fri, Apr 21, 2023 at 08:11:31AM -0700, Breno Leitao wrote:
> On Thu, Apr 20, 2023 at 06:57:12AM +0200, Christoph Hellwig wrote:
> > On Wed, Apr 19, 2023 at 03:29:29AM -0700, Breno Leitao wrote:
> > > struct nvme_uring_cmd_pdu *pdu = nvme_uring_cmd_pdu(ioucmd);
> > > - const struct nvme_uring_cmd *cmd = ioucmd->cmd;
> > > + const struct nvme_uring_cmd *cmd = (struct nvme_uring_cmd *)ioucmd->sqe->cmd;
> >
> > Please don't add the pointless cast. And in general avoid the overly
> > long lines.
>
> If I don't add this cast, the compiler complains with the follow error:
>
> drivers/nvme/host/ioctl.c: In function ‘nvme_uring_cmd_io’:
> drivers/nvme/host/ioctl.c:555:37: error: initialization of ‘const struct nvme_uring_cmd *’ from incompatible pointer type ‘const __u8 *’ {aka ‘const unsigned char *’} [-Werror=incompatible-pointer-types]
> const struct nvme_uring_cmd *cmd = ioucmd->sqe->cmd;
Oh. I think then we need a helper to get the private data from
the io_uring_cmd as an interface that requires casts in all callers
is one asking for bugs.
next prev parent reply other threads:[~2023-04-24 5:09 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-19 10:29 [PATCH 0/2] io_uring: Pass whole sqe to commands Breno Leitao
2023-04-19 10:29 ` [PATCH 1/2] " Breno Leitao
2023-04-20 4:57 ` Christoph Hellwig
2023-04-20 12:29 ` Breno Leitao
2023-04-20 12:31 ` Christoph Hellwig
2023-04-20 12:38 ` Breno Leitao
2023-04-20 12:46 ` Christoph Hellwig
2023-04-30 14:37 ` Breno Leitao
2023-04-21 15:11 ` Breno Leitao
2023-04-24 5:08 ` Christoph Hellwig [this message]
2023-04-19 10:29 ` [PATCH 2/2] io_uring: Remove unnecessary BUILD_BUG_ON Breno Leitao
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=20230424050843.GA9252@lst.de \
--to=hch@lst.de \
--cc=asml.silence@gmail.com \
--cc=axboe@kernel.dk \
--cc=io-uring@vger.kernel.org \
--cc=kbusch@kernel.org \
--cc=leit@fb.com \
--cc=leitao@debian.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=ming.lei@redhat.com \
--cc=sagi@grimberg.me \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.