lkml.org 
[lkml]   [2012]   [Jan]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/4] coda: Remove unnecessary OOM messages
From
Date
> Since CODA_ALLOC no longer uses __FILE__ and __LINE__ and doesn't use
> the cast argument any more, it can be replaced with a static inline
> function. Something like this (untested, applies on top of your patch):

Hi Ryan.

I didn't want to be quite so invasive
but this looks like a nice cleanup to me.

Maybe because alloc/free functions are
used relatively infrequently, maybe it'd
be better to not declare the functions
inline but add them to coda_linux.c

> +static inline void *coda_alloc(size_t size)
> +{
> + if (size < PAGE_SIZE)
> + return kzalloc(size, GFP_KERNEL);
> + return vzalloc(size);
> +}
[]
> +static inline void coda_free(const void *ptr, size_t size)
> +{
> + if (size < PAGE_SIZE)
> + kfree(ptr);
> + else
> + vfree(ptr);
> +}




\
 
 \ /
  Last update: 2012-02-01 01:23    [from the cache]
©2003-2011 Jasper Spaans