public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Roel Kluin <12o3l@tiscali.nl>
To: airlied@linux.ie
Cc: lkml <linux-kernel@vger.kernel.org>
Subject: [PATCH] pci-gart_64: comparison between signed and unsigned
Date: Sat, 19 Apr 2008 08:13:08 +0200	[thread overview]
Message-ID: <48098D74.9060106@tiscali.nl> (raw)

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) {

                 reply	other threads:[~2008-04-19  6:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48098D74.9060106@tiscali.nl \
    --to=12o3l@tiscali.nl \
    --cc=airlied@linux.ie \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox