public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pci-gart_64: comparison between signed and unsigned
@ 2008-04-19  6:13 Roel Kluin
  0 siblings, 0 replies; only message in thread
From: Roel Kluin @ 2008-04-19  6:13 UTC (permalink / raw)
  To: airlied; +Cc: lkml

Can you confirm this is right, especially the last case?
---
Fix comparison between signed and unsigned

Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
---
diff --git a/arch/x86/kernel/pci-gart_64.c b/arch/x86/kernel/pci-gart_64.c
index 700e464..7af1991 100644
--- a/arch/x86/kernel/pci-gart_64.c
+++ b/arch/x86/kernel/pci-gart_64.c
@@ -97,12 +97,12 @@ static unsigned long alloc_iommu(struct device *dev, int size)
 	spin_lock_irqsave(&iommu_bitmap_lock, flags);
 	offset = iommu_area_alloc(iommu_gart_bitmap, iommu_pages, next_bit,
 				  size, base_index, boundary_size, 0);
-	if (offset == -1) {
+	if (offset == -1ul) {
 		need_flush = 1;
 		offset = iommu_area_alloc(iommu_gart_bitmap, iommu_pages, 0,
 					  size, base_index, boundary_size, 0);
 	}
-	if (offset != -1) {
+	if (offset != -1ul) {
 		set_bit_string(iommu_gart_bitmap, offset, size);
 		next_bit = offset+size;
 		if (next_bit >= iommu_pages) {
@@ -246,7 +246,7 @@ static dma_addr_t dma_map_area(struct device *dev, dma_addr_t phys_mem,
 	unsigned long iommu_page = alloc_iommu(dev, npages);
 	int i;
 
-	if (iommu_page == -1) {
+	if (iommu_page == -1ul) {
 		if (!nonforced_iommu(dev, phys_mem, size))
 			return phys_mem;
 		if (panic_on_overflow)
@@ -372,7 +372,7 @@ static int __dma_map_cont(struct device *dev, struct scatterlist *start,
 	struct scatterlist *s;
 	int i;
 
-	if (iommu_start == -1)
+	if (iommu_start == -1ul)
 		return -1;
 
 	for_each_sg(start, s, nelems, i) {

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

only message in thread, other threads:[~2008-04-19  6:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-19  6:13 [PATCH] pci-gart_64: comparison between signed and unsigned Roel Kluin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox