[PATCH] pci-gart_64: comparison between signed and unsigned

From: Roel Kluin
Date: Sat Apr 19 2008 - 02:13:22 EST


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

Signed-off-by: Roel Kluin <12o3l@xxxxxxxxxx>
---
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) {
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/