[PATCH] drm/amdgpu/psp: Use %p for printing pointers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Michel Dänzer <michel.daenzer@xxxxxxx>

The compiler was warning:

In file included from drivers/gpu/drm//amd/amdgpu/amdgpu.h:45:0,
                 from drivers/gpu/drm//amd/amdgpu/psp_v10_0.c:27:
drivers/gpu/drm//amd/amdgpu/psp_v10_0.c: In function â??psp_v10_0_cmd_submitâ??:
drivers/gpu/drm//amd/amdgpu/psp_v10_0.c:277:13: warning: format â??%xâ?? expects argument of type â??unsigned intâ??, but argument 4 has type â??struct psp_gfx_rb_frame *â?? [-Wformat=]
   DRM_ERROR("ring_buffer_start = %x; ring_buffer_end = %x; write_frame = %x\n",
             ^
./include/drm/drmP.h:178:36: note: in definition of macro â??DRM_ERRORâ??
  drm_printk(KERN_ERR, DRM_UT_NONE, fmt, ##__VA_ARGS__)
                                    ^~~
drivers/gpu/drm//amd/amdgpu/psp_v10_0.c:277:13: warning: format â??%xâ?? expects argument of type â??unsigned intâ??, but argument 5 has type â??struct psp_gfx_rb_frame *â?? [-Wformat=]
   DRM_ERROR("ring_buffer_start = %x; ring_buffer_end = %x; write_frame = %x\n",
             ^
./include/drm/drmP.h:178:36: note: in definition of macro â??DRM_ERRORâ??
  drm_printk(KERN_ERR, DRM_UT_NONE, fmt, ##__VA_ARGS__)
                                    ^~~
drivers/gpu/drm//amd/amdgpu/psp_v10_0.c:277:13: warning: format â??%xâ?? expects argument of type â??unsigned intâ??, but argument 6 has type â??struct psp_gfx_rb_frame *â?? [-Wformat=]
   DRM_ERROR("ring_buffer_start = %x; ring_buffer_end = %x; write_frame = %x\n",
             ^
./include/drm/drmP.h:178:36: note: in definition of macro â??DRM_ERRORâ??
  drm_printk(KERN_ERR, DRM_UT_NONE, fmt, ##__VA_ARGS__)
                                    ^~~

While at it, fix the formatting of the second line, making the code
smaller and easier to read.

Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/psp_v10_0.c | 6 ++----
 drivers/gpu/drm/amd/amdgpu/psp_v3_1.c  | 6 ++----
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/psp_v10_0.c b/drivers/gpu/drm/amd/amdgpu/psp_v10_0.c
index 26e10ab678fa..4e20d91d5d50 100644
--- a/drivers/gpu/drm/amd/amdgpu/psp_v10_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/psp_v10_0.c
@@ -274,10 +274,8 @@ int psp_v10_0_cmd_submit(struct psp_context *psp,
 		write_frame = ring_buffer_start + (psp_write_ptr_reg / rb_frame_size_dw);
 	/* Check invalid write_frame ptr address */
 	if ((write_frame < ring_buffer_start) || (ring_buffer_end < write_frame)) {
-		DRM_ERROR("ring_buffer_start = %x; ring_buffer_end = %x; write_frame = %x\n",
-				ring_buffer_start,
-				ring_buffer_end,
-				write_frame);
+		DRM_ERROR("ring_buffer_start = %p; ring_buffer_end = %p; write_frame = %p\n",
+			  ring_buffer_start, ring_buffer_end, write_frame);
 		DRM_ERROR("write_frame is pointing to address out of bounds\n");
 		return -EINVAL;
 	}
diff --git a/drivers/gpu/drm/amd/amdgpu/psp_v3_1.c b/drivers/gpu/drm/amd/amdgpu/psp_v3_1.c
index d2170500cd72..c7bcfe8e286c 100644
--- a/drivers/gpu/drm/amd/amdgpu/psp_v3_1.c
+++ b/drivers/gpu/drm/amd/amdgpu/psp_v3_1.c
@@ -386,10 +386,8 @@ int psp_v3_1_cmd_submit(struct psp_context *psp,
 		write_frame = ring_buffer_start + (psp_write_ptr_reg / rb_frame_size_dw);
 	/* Check invalid write_frame ptr address */
 	if ((write_frame < ring_buffer_start) || (ring_buffer_end < write_frame)) {
-		DRM_ERROR("ring_buffer_start = %x; ring_buffer_end = %x; write_frame = %x\n",
-				ring_buffer_start,
-				ring_buffer_end,
-				write_frame);
+		DRM_ERROR("ring_buffer_start = %p; ring_buffer_end = %p; write_frame = %p\n",
+			  ring_buffer_start, ring_buffer_end, write_frame);
 		DRM_ERROR("write_frame is pointing to address out of bounds\n");
 		return -EINVAL;
 	}
-- 
2.15.0.rc1



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux