[Nouveau] [PATCH 5/7] drm/nouveau: use PTR_ERR instead of a cast

Pekka Paalanen pq at iki.fi
Sat Aug 8 00:39:00 PDT 2009


A small cleanup in using the ERR_PTR API.

Signed-off-by: Pekka Paalanen <pq at iki.fi>
---
 drivers/gpu/drm/nouveau/nouveau_gem.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c
index 670348b..bbef95d 100644
--- a/drivers/gpu/drm/nouveau/nouveau_gem.c
+++ b/drivers/gpu/drm/nouveau/nouveau_gem.c
@@ -482,19 +482,19 @@ nouveau_gem_ioctl_pushbuf(struct drm_device *dev, void *data,
 
 	pushbuf = u_memcpya(req->dwords, req->nr_dwords, sizeof(uint32_t));
 	if (IS_ERR(pushbuf))
-		return (unsigned long)pushbuf;
+		return PTR_ERR(pushbuf);
 
 	bo = u_memcpya(req->buffers, req->nr_buffers, sizeof(*bo));
 	if (IS_ERR(bo)) {
 		kfree(pushbuf);
-		return (unsigned long)bo;
+		return PTR_ERR(bo);
 	}
 
 	reloc = u_memcpya(req->relocs, req->nr_relocs, sizeof(*reloc));
 	if (IS_ERR(reloc)) {
 		kfree(bo);
 		kfree(pushbuf);
-		return (unsigned long)reloc;
+		return PTR_ERR(reloc);
 	}
 
 	mutex_lock(&dev->struct_mutex);
-- 
1.6.3.3



More information about the Nouveau mailing list