lkml.org 
[lkml]   [2019]   [Jan]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH trivial] kernel.h: Make container_of_safe type safe
On Thu, Jan 24, 2019 at 08:55:05PM +0000, Jason Gunthorpe wrote:
> The final ternary expression is given void * and type * as arguments, so
> the resulting type of the macro ends up being void *.
>
> container_of returns a type which maches the argument, this provides type
> safety and allows the expression to be immediately used as the target
> type.
>
> Explicitly cast ERR_CAST() to get the correct type.

I think we should just kill off container_of_safe - it has no user
in the tree, is grossly misnamed and not really all that useful to start
with.

\
 
 \ /
  Last update: 2019-01-28 14:43    [W:0.053 / U:0.816 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site