[PATCH] drm/amdkfd: Fix printing pointer cast

Felix Kuehling felix.kuehling at amd.com
Thu Nov 30 19:09:41 UTC 2017


Hi Kent,

I just realized when looking at this again, that you could remove the 0x
before %p. I think %p will print 0x<address> itself.

Regards,
  Felix


On 2017-11-30 11:49 AM, Kent Russell wrote:
> Just print a pointer instead of casting
>
> Signed-off-by: Kent Russell <kent.russell at amd.com>
> ---
>  drivers/gpu/drm/amd/amdkfd/kfd_doorbell.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_doorbell.c b/drivers/gpu/drm/amd/amdkfd/kfd_doorbell.c
> index feb76c2..8abaa08 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_doorbell.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_doorbell.c
> @@ -116,8 +116,7 @@ int kfd_doorbell_init(struct kfd_dev *kfd)
>  	pr_debug("doorbell aperture size  == 0x%08lX\n",
>  			kfd->shared_resources.doorbell_aperture_size);
>  
> -	pr_debug("doorbell kernel address == 0x%08lX\n",
> -			(uintptr_t)kfd->doorbell_kernel_ptr);
> +	pr_debug("doorbell kernel address == 0x%p\n", kfd->doorbell_kernel_ptr);
>  
>  	return 0;
>  }
> @@ -194,8 +193,8 @@ u32 __iomem *kfd_get_kernel_doorbell(struct kfd_dev *kfd,
>  
>  	pr_debug("Get kernel queue doorbell\n"
>  			 "     doorbell offset   == 0x%08X\n"
> -			 "     kernel address    == 0x%08lX\n",
> -		*doorbell_off, (uintptr_t)(kfd->doorbell_kernel_ptr + inx));
> +			 "     kernel address    == 0x%p\n",
> +		*doorbell_off, (kfd->doorbell_kernel_ptr + inx));
>  
>  	return kfd->doorbell_kernel_ptr + inx;
>  }



More information about the amd-gfx mailing list