Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/xe: Use ERR_CAST to return an error-valued pointer

Instead of directly casting and returning an error-valued pointer,
use ERR_CAST to make the error handling more explicit and improve
code clarity.

Signed-off-by: Yu Jiaoliang <yujiaoliang@vivo.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240906070109.1852860-1-yujiaoliang@vivo.com

authored by

Yu Jiaoliang and committed by
Matthew Brost
bbb1ed0b f96dbf7c

+1 -1
+1 -1
drivers/gpu/drm/xe/xe_sa.c
··· 53 53 if (IS_ERR(bo)) { 54 54 drm_err(&xe->drm, "failed to allocate bo for sa manager: %ld\n", 55 55 PTR_ERR(bo)); 56 - return (struct xe_sa_manager *)bo; 56 + return ERR_CAST(bo); 57 57 } 58 58 sa_manager->bo = bo; 59 59 sa_manager->is_iomem = bo->vmap.is_iomem;