Lines Matching defs:r2
231 /* True iff r1 completely contains r2 */
232 static inline bool resource_contains(const struct resource *r1, const struct resource *r2)
234 if (resource_type(r1) != resource_type(r2))
236 if (r1->flags & IORESOURCE_UNSET || r2->flags & IORESOURCE_UNSET)
238 return r1->start <= r2->start && r1->end >= r2->end;
241 /* True if any part of r1 overlaps r2 */
242 static inline bool resource_overlaps(const struct resource *r1, const struct resource *r2)
244 return r1->start <= r2->end && r1->end >= r2->start;
247 static inline bool resource_intersection(const struct resource *r1, const struct resource *r2,
250 if (!resource_overlaps(r1, r2))
252 r->start = max(r1->start, r2->start);
253 r->end = min(r1->end, r2->end);
257 static inline bool resource_union(const struct resource *r1, const struct resource *r2,
260 if (!resource_overlaps(r1, r2))
262 r->start = min(r1->start, r2->start);
263 r->end = max(r1->end, r2->end);