<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">
From: Adam Belay &lt;ambx1@neo.rr.com&gt;

This patch cleans up the resource conflict logic and was originally from
Matthew Wilcox &lt;willy@debian.org&gt;.


---

 25-akpm/drivers/pnp/resource.c |   10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)

diff -puN drivers/pnp/resource.c~pnp-01-resource-conflict-cleanup drivers/pnp/resource.c
--- 25/drivers/pnp/resource.c~pnp-01-resource-conflict-cleanup	2004-03-14 23:58:03.082412600 -0800
+++ 25-akpm/drivers/pnp/resource.c	2004-03-14 23:58:03.083412448 -0800
@@ -231,15 +231,9 @@ void pnp_free_option(struct pnp_option *
 
 #define length(start, end) (*(end) - *(start) + 1)
 
-/* ranged_conflict - used to determine if two resource ranges conflict
- * condition 1: check if the start of a is within b
- * condition 2: check if the end of a is within b
- * condition 3: check if b is engulfed by a */
-
+/* Two ranges conflict if one doesn't end before the other starts */
 #define ranged_conflict(starta, enda, startb, endb) \
-((*(starta) &gt;= *(startb) &amp;&amp; *(starta) &lt;= *(endb)) || \
- (*(enda) &gt;= *(startb) &amp;&amp; *(enda) &lt;= *(endb)) || \
- (*(starta) &lt; *(startb) &amp;&amp; *(enda) &gt; *(endb)))
+	!((*(enda) &lt; *(startb)) || (*(endb) &lt; *(starta)))
 
 #define cannot_compare(flags) \
 ((flags) &amp; (IORESOURCE_UNSET | IORESOURCE_DISABLED))

_
</pre></body></html>