Re: [PATCH 2/5] drm/i915: i915_dma_map_single returns positive error codes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 3/24/2015 4:03 PM, Dan Carpenter wrote:
On Tue, Mar 24, 2015 at 06:57:13PM +0300, Dan Carpenter wrote:
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index 645c363..79ade6f 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -348,7 +348,7 @@ static struct i915_page_table_entry *alloc_pt_single(struct drm_device *dev)
  		goto fail_page;
ret = i915_dma_map_single(pt, dev);
-	if (ret)
+	if (ret != 0)
Heh.  What is this?  :P  You just added a double negative.  Just change
to return negative error codes on failure.
Oops.  I left out a word.  That should say "Just change
i915_dma_map_page_single() to negative error codes on failure."

Currently, it returns 0 on success and 1 on failure which is
non-standard.
Ok, the function is returning the value straight from dma_mapping_error(),
I'll change i915_dma_map_page_single() to return -ENOMEM when dma_mapping_error doesn't return 0.

Thanks,

-Michel
regards,
dan carpenter

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx





[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux