[Nouveau] [PATCH] drm/nouveau/gem: fix err_cast.cocci warnings
kernel test robot
lkp at intel.com
Thu Aug 13 13:12:08 UTC 2020
From: kernel test robot <lkp at intel.com>
drivers/gpu/drm/nouveau/nouveau_gem.c:589:9-16: WARNING: ERR_CAST can be used with mem
Use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(...))
Generated by: scripts/coccinelle/api/err_cast.cocci
CC: Markus Elfring <elfring at users.sourceforge.net>
Signed-off-by: kernel test robot <lkp at intel.com>
---
url: https://github.com/0day-ci/linux/commits/Markus-Elfring/drm-nouveau-gem-Use-vmemdup_user-rather-than-duplicating-its-implementation/20200812-150757
base: git://anongit.freedesktop.org/drm-intel for-linux-next
nouveau_gem.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/gpu/drm/nouveau/nouveau_gem.c
+++ b/drivers/gpu/drm/nouveau/nouveau_gem.c
@@ -586,7 +586,7 @@ u_memcpya(uint64_t user, unsigned nmemb,
size *= nmemb;
mem = vmemdup_user(userptr, size);
if (IS_ERR(mem))
- return ERR_PTR(PTR_ERR(mem));
+ return ERR_CAST(mem);
return mem;
}
More information about the Nouveau
mailing list