On Wed, Jan 29, 2025 at 03:56:01PM +1030, Gustavo A. R. Silva wrote:
> This is like container_of_const() but it contains an assert to
> ensure that it's using the first member in the structure.

But why?  If you "know" it's the first member, just do a normal cast.
If you don't, then you probably shouldn't be caring about this anyway,
right?

> 
> Co-developed-by: Dan Carpenter <dan.carpen...@linaro.org>
> Signed-off-by: Dan Carpenter <dan.carpen...@linaro.org>
> Signed-off-by: Gustavo A. R. Silva <gustavo...@kernel.org>
> ---
> 
> I will be using this in my -Wflex-array-member-not-at-end patches. :)

Confused, I'd like to see some users first please.

thanks,

greg k-h

Reply via email to