Staging: android: ashmem.c: Redefine macros as static inline functions
authorBhumika Goyal <bhumirks@gmail.com>
Fri, 11 Mar 2016 14:03:04 +0000 (19:33 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 12 Mar 2016 06:09:09 +0000 (22:09 -0800)
commite2a83f328f55b12b896c1467631ca414ac22980f
treefe918d8a261cf541542b7d052f0e55a38d704dc5
parent0103fe20a7dd343c43bec6215e01cd6bedddd5eb
Staging: android: ashmem.c: Redefine macros as static inline functions

Convert macros page_in_range and range_before_page into static inline
functions as static inline functions are preferred over macros. The
change can be done as the arguments at all call sites have the same type.
Also, both the macros have same type of arguments and return
values.
Done using coccinelle:

@r@
identifier f;
expression e;
@@
#define f(...) e

@r1@
identifier r.f;
identifier range,page;
expression r.e;
@@
- #define f(range,page) e
+ static inline int f(struct ashmem_range *range, size_t page)
+ {
+ return e;
+ }

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/android/ashmem.c
This page took 0.025466 seconds and 5 git commands to generate.