Message ID | 20201103203655.17701-2-andriy.shevchenko@linux.intel.com |
---|---|
State | Accepted |
Commit | 66f4fa32eb18af9a60bbda589ee239621a49bcc1 |
Headers | show |
Series | [v5,1/7] resource: Simplify region_intersects() by reducing conditionals | expand |
diff --git a/kernel/resource.c b/kernel/resource.c index 3ae2f56cc79d..82df80417489 100644 --- a/kernel/resource.c +++ b/kernel/resource.c @@ -557,13 +557,13 @@ int region_intersects(resource_size_t start, size_t size, unsigned long flags, } read_unlock(&resource_lock); - if (other == 0) - return type ? REGION_INTERSECTS : REGION_DISJOINT; + if (type == 0) + return REGION_DISJOINT; - if (type) - return REGION_MIXED; + if (other == 0) + return REGION_INTERSECTS; - return REGION_DISJOINT; + return REGION_MIXED; } EXPORT_SYMBOL_GPL(region_intersects);