return (va >= TASK_SIZE_MAX) || ((va + len - 1) >= TASK_SIZE_MAX);
}
+/*
+ * Checks whether the range [addr, end], overlaps the area [base, base + size).
+ */
+static inline bool within_area(unsigned long addr, unsigned long end,
+ unsigned long base, unsigned long size)
+{
+ return end >= base && addr < (base + size);
+}
+
/*
* Checks whether the range from addr to end, inclusive, overlaps the CPU
* entry area range.
*/
static inline bool within_cpu_entry_area(unsigned long addr, unsigned long end)
{
- return end >= CPU_ENTRY_AREA_BASE &&
- addr < (CPU_ENTRY_AREA_BASE + CPU_ENTRY_AREA_TOTAL_SIZE);
+ return within_area(addr, end, CPU_ENTRY_AREA_BASE,
+ CPU_ENTRY_AREA_TOTAL_SIZE);
}
static int arch_build_bp_info(struct perf_event *bp,