1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
From 64c6f0da691300e62f39e413f91f7b044eb73c20 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <michel.daenzer@amd.com>
Date: Mon, 23 Oct 2017 16:40:47 +0200
Subject: [PATCH 2064/4131] drm/amdgpu/psp: Use %p for printing pointers
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
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.
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@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 410dd78..1e4aa4e 100644
--- a/drivers/gpu/drm/amd/amdgpu/psp_v10_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/psp_v10_0.c
@@ -277,10 +277,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 d217050..c7bcfe8 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.7.4
|