[PATCH 06/13] drm/xe/sa: Tidy up coding style in init()

Matthew Brost matthew.brost at intel.com
Thu Dec 12 03:11:15 UTC 2024


On Thu, Dec 12, 2024 at 02:01:34AM +0100, Michal Wajdeczko wrote:
> There is no need to use tile_to_xe() since we already got the xe.
> And we should keep all variable declarations together, no need for
> separate sa_manager declaration.
> 
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko at intel.com>
> Cc: Matthew Brost <matthew.brost at intel.com>

Reviewed-by: Matthew Brost <matthew.brost at intel.com>

> ---
>  drivers/gpu/drm/xe/xe_sa.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_sa.c b/drivers/gpu/drm/xe/xe_sa.c
> index 94d22371af84..704332ef795f 100644
> --- a/drivers/gpu/drm/xe/xe_sa.c
> +++ b/drivers/gpu/drm/xe/xe_sa.c
> @@ -35,13 +35,12 @@ static void sa_bo_manager_fini_bo(void *arg)
>  struct xe_sa_manager *xe_sa_bo_manager_init(struct xe_tile *tile, u32 size, u32 align)
>  {
>  	struct xe_device *xe = tile_to_xe(tile);
> +	struct xe_sa_manager *sa_manager;
>  	u32 managed_size = size - SZ_4K;
>  	struct xe_bo *bo;
>  	int ret;
>  
> -	struct xe_sa_manager *sa_manager = drmm_kzalloc(&tile_to_xe(tile)->drm,
> -							sizeof(*sa_manager),
> -							GFP_KERNEL);
> +	sa_manager = drmm_kzalloc(&xe->drm, sizeof(*sa_manager), GFP_KERNEL);
>  	if (!sa_manager)
>  		return ERR_PTR(-ENOMEM);
>  
> -- 
> 2.47.1
> 


More information about the Intel-xe mailing list