Skip to contentSkip to conversation

ia64: Fix tests on unsigned

PATCH New Roel Kluin 1 participant 1 message Oct 17, 2009

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 ia64: Fix tests on unsigned

struct ate_resource member lowest_free_index is unsigned, the test was invalid.

---

arch/ia64/sn/pci/pcibr/pcibr_ate.c +2 -3
index 5bc34ea..12a5a9c 100644
@@ -70,8 +70,7 @@ static inline void free_ate_resource(struct ate_resource *ate_resource,
 				     int start)
 {
 	mark_ate(ate_resource, start, ate_resource->ate[start], 0);
-	if ((ate_resource->lowest_free_index > start) ||
-	    (ate_resource->lowest_free_index < 0))
+	if (ate_resource->lowest_free_index > start)
 		ate_resource->lowest_free_index = start;
 }
 
@@ -86,7 +85,7 @@ static inline int alloc_ate_resource(struct ate_resource *ate_resource,
 	/*
 	 * Check for ate exhaustion.
 	 */
-	if (ate_resource->lowest_free_index < 0)
+	if (ate_resource->lowest_free_index = -1)
 		return -1;
 
 	/*