[PATCH] nouveau: Use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(.. [1]

Thomas Meyer thomas at m3y3r.de
Mon Aug 6 23:57:25 PDT 2012


The semantic patch that makes this change is available
in scripts/coccinelle/api/err_cast.cocci.

More information about semantic patching is available at
http://coccinelle.lip6.fr/

Signed-off-by: Thomas Meyer <thomas at m3y3r.de>
---

diff -u -p a/drivers/gpu/drm/nouveau/nouveau_prime.c b/drivers/gpu/drm/nouveau/nouveau_prime.c
--- a/drivers/gpu/drm/nouveau/nouveau_prime.c
+++ b/drivers/gpu/drm/nouveau/nouveau_prime.c
@@ -206,7 +206,7 @@ struct drm_gem_object *nouveau_gem_prime
 	/* need to attach */
 	attach = dma_buf_attach(dma_buf, dev->dev);
 	if (IS_ERR(attach))
-		return ERR_PTR(PTR_ERR(attach));
+		return ERR_CAST(attach);
 
 	sg = dma_buf_map_attachment(attach, DMA_BIDIRECTIONAL);
 	if (IS_ERR(sg)) {


More information about the dri-devel mailing list