All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] [IA64] pci_br: fix a signedness bug
@ 2016-08-04  5:38 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2016-08-04  5:38 UTC (permalink / raw)
  To: kernel-janitors

ate_resource->lowest_free_index is unsigned so it's never less than
zero.  I've changed it to test for = -1.  This happens when there
aren't any free ates left.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
I can't compile this actually...

diff --git a/arch/ia64/sn/pci/pcibr/pcibr_ate.c b/arch/ia64/sn/pci/pcibr/pcibr_ate.c
index 5bc34ea..024ae9b 100644
--- a/arch/ia64/sn/pci/pcibr/pcibr_ate.c
+++ b/arch/ia64/sn/pci/pcibr/pcibr_ate.c
@@ -71,7 +71,7 @@ static inline void free_ate_resource(struct ate_resource *ate_resource,
 {
 	mark_ate(ate_resource, start, ate_resource->ate[start], 0);
 	if ((ate_resource->lowest_free_index > start) ||
-	    (ate_resource->lowest_free_index < 0))
+	    (ate_resource->lowest_free_index = -1))
 		ate_resource->lowest_free_index = start;
 }
 
@@ -86,7 +86,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;
 
 	/*

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-08-04  5:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-04  5:38 [patch] [IA64] pci_br: fix a signedness bug Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.