Re: [PATCH 01/13] RDMA/verbs: Convert struct ib_send_wr conversion functions into macros

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

 



On Fri, Jul 06, 2018 at 06:08:59PM +0000, Bart Van Assche wrote:
> On Fri, 2018-07-06 at 11:33 -0600, Jason Gunthorpe wrote:
> > container_of is not const preserving, so it happily strips the const
> > off the input pointer, which is what the inline wrappers would do if they
> > were marked to accept a const - so why convert them to #define's?
> 
> As mentioned in the description of patch 1/13, there is code upstream that
> modifies the data the returned pointer points at.
> 
> > I'm actually a bit surprised this works, I think it might be a bug in
> > the container_of macro's type checking that it is ignoring the const
> > qualifier on the input pointer - not totally sure I want to rely on that
> >
> > I'd like this alot better if container_of could propogate const, but
> > can't think of a way to achieve that.
> 
> How about keeping the inline functions, to declare the argument and return
> types const, and to use container_of() directly in the iSER driver?

I think I would prefer that, at least it is const preserving, not
const discarding that way.

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux