lkml.org 
[lkml]   [2014]   [Feb]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 2/9] slab: makes clear_obj_pfmemalloc() just return store masked value
    On Fri, 14 Feb 2014, Christoph Lameter wrote:

    > > @@ -215,9 +215,9 @@ static inline void set_obj_pfmemalloc(void **objp)
    > > return;
    > > }
    > >
    > > -static inline void clear_obj_pfmemalloc(void **objp)
    > > +static inline void *clear_obj_pfmemalloc(void *objp)
    > > {
    > > - *objp = (void *)((unsigned long)*objp & ~SLAB_OBJ_PFMEMALLOC);
    > > + return (void *)((unsigned long)objp & ~SLAB_OBJ_PFMEMALLOC);
    > > }
    >
    > I dont think you need the (void *) cast here.
    >

    Yeah, you don't need it, but don't you think it makes the code more
    readable? Otherwise this is going to be just doing

    return (unsigned long)objp & ~SLAB_OBJ_PFMEMALLOC;

    and you gotta figure out the function type to understand it's returned as
    a pointer.


    \
     
     \ /
      Last update: 2014-02-15 00:41    [W:6.247 / U:0.028 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site