Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Guillaume Tucker and committed by
Greg Kroah-Hartman
40270ca0 e895f00a

+8 -4
+8 -4
drivers/staging/android/ashmem.c
··· 100 100 static struct kmem_cache *ashmem_area_cachep __read_mostly; 101 101 static struct kmem_cache *ashmem_range_cachep __read_mostly; 102 102 103 - #define range_size(range) \ 104 - ((range)->pgend - (range)->pgstart + 1) 103 + static inline unsigned long range_size(struct ashmem_range *range) 104 + { 105 + return range->pgend - range->pgstart + 1; 106 + } 105 107 106 - #define range_on_lru(range) \ 107 - ((range)->purged == ASHMEM_NOT_PURGED) 108 + static inline bool range_on_lru(struct ashmem_range *range) 109 + { 110 + return range->purged == ASHMEM_NOT_PURGED; 111 + } 108 112 109 113 static inline int page_range_subsumes_range(struct ashmem_range *range, 110 114 size_t start, size_t end)