return range->purged == ASHMEM_NOT_PURGED;
}
-static inline int page_range_subsumes_range(struct ashmem_range *range,
- size_t start, size_t end)
+static inline bool page_range_subsumes_range(struct ashmem_range *range,
+ size_t start, size_t end)
{
- return (((range)->pgstart >= (start)) && ((range)->pgend <= (end)));
+ return (range->pgstart >= start) && (range->pgend <= end);
}
-static inline int page_range_subsumed_by_range(struct ashmem_range *range,
- size_t start, size_t end)
+static inline bool page_range_subsumed_by_range(struct ashmem_range *range,
+ size_t start, size_t end)
{
- return (((range)->pgstart <= (start)) && ((range)->pgend >= (end)));
+ return (range->pgstart <= start) && (range->pgend >= end);
}
-static inline int page_in_range(struct ashmem_range *range, size_t page)
+static inline bool page_in_range(struct ashmem_range *range, size_t page)
{
- return (((range)->pgstart <= (page)) && ((range)->pgend >= (page)));
+ return (range->pgstart <= page) && (range->pgend >= page);
}
-static inline int page_range_in_range(struct ashmem_range *range,
- size_t start, size_t end)
+static inline bool page_range_in_range(struct ashmem_range *range,
+ size_t start, size_t end)
{
- return (page_in_range(range, start) || page_in_range(range, end) ||
- page_range_subsumes_range(range, start, end));
+ return page_in_range(range, start) || page_in_range(range, end) ||
+ page_range_subsumes_range(range, start, end);
}
-static inline int range_before_page(struct ashmem_range *range, size_t page)
+static inline bool range_before_page(struct ashmem_range *range, size_t page)
{
- return ((range)->pgend < (page));
+ return range->pgend < page;
}
#define PROT_MASK (PROT_EXEC | PROT_READ | PROT_WRITE)