Re: [PATCH v3 4/4] block: ublk_drv: Add a helper instead of casting

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

 



On Mon, May 01, 2023 at 06:31:22AM +0200, Christoph Hellwig wrote:
> On Sun, Apr 30, 2023 at 07:35:32AM -0700, Breno Leitao wrote:
> > ublk driver is using casts to get private data from uring cmd struct.
> > Let's use a proper helper, as an interface that requires casts in all
> > callers is one asking for bugs.
> > 
> > Suggested-by: Christoph Hellwig <hch@xxxxxx>
> 
> No, I've not suggested this.
> 
> > +static inline struct ublksrv_ctrl_cmd *ublk_uring_ctrl_cmd(
> > +		struct io_uring_cmd *cmd)
> > +{
> > +	return (struct ublksrv_ctrl_cmd *)cmd->sqe->cmd;
> > +}
> 
> I've two times explained we need a core io_uring helper to remove this
> casting in the drivers, and I've explained how to do that and provided
> the actual code for it.

Sorry for it, somehow I misunderstood what you meant. I re-read the
thread and got what you said.

I am preparing a V4 with the new approach, and I will send it tomorrow.



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux