diff options
author | Guillaume Tucker <guillaume.tucker@gmail.com> | 2016-12-05 18:55:23 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-12-06 10:18:07 +0100 |
commit | 40270ca0de2deef44ba53c4fd88dc39fddcd006d (patch) | |
tree | 24c764d68047358cd6240a5488c73c4188fb1010 /drivers/staging/android | |
parent | e895f00a84965a2fef2cee0cb06f2f59154186f0 (diff) |
staging: android: ashmem: convert range macros to inlines
Convert range_size and range_on_lru macros to inline functions to
fix checkpatch check:
CHECK: Macro argument reuse 'range' - possible side-effects?
Signed-off-by: Guillaume Tucker <guillaume.tucker@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/android')
-rw-r--r-- | drivers/staging/android/ashmem.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/staging/android/ashmem.c b/drivers/staging/android/ashmem.c index ca9a53c03f0f..facc8a247707 100644 --- a/drivers/staging/android/ashmem.c +++ b/drivers/staging/android/ashmem.c @@ -100,11 +100,15 @@ static DEFINE_MUTEX(ashmem_mutex); static struct kmem_cache *ashmem_area_cachep __read_mostly; static struct kmem_cache *ashmem_range_cachep __read_mostly; -#define range_size(range) \ - ((range)->pgend - (range)->pgstart + 1) +static inline unsigned long range_size(struct ashmem_range *range) +{ + return range->pgend - range->pgstart + 1; +} -#define range_on_lru(range) \ - ((range)->purged == ASHMEM_NOT_PURGED) +static inline bool range_on_lru(struct ashmem_range *range) +{ + return range->purged == ASHMEM_NOT_PURGED; +} static inline int page_range_subsumes_range(struct ashmem_range *range, size_t start, size_t end) |