From b3a83639895a422b25f72eec0a5d1d88c3ac4e9e Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Fri, 30 Sep 2005 18:37:36 +1000 Subject: drm: fix all sparse warning on 32-bit x86 Finally cleaned up the sparse warnings for the drm. Signed-off-by: Dave Airlie --- drivers/char/drm/r300_cmdbuf.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'drivers/char/drm/r300_cmdbuf.c') diff --git a/drivers/char/drm/r300_cmdbuf.c b/drivers/char/drm/r300_cmdbuf.c index aa66f46279e7..3a1ac5f78b43 100644 --- a/drivers/char/drm/r300_cmdbuf.c +++ b/drivers/char/drm/r300_cmdbuf.c @@ -53,7 +53,7 @@ static const int r300_cliprect_cntl[4] = { * buffer, starting with index n. */ static int r300_emit_cliprects(drm_radeon_private_t * dev_priv, - drm_radeon_cmd_buffer_t * cmdbuf, int n) + drm_radeon_kcmd_buffer_t * cmdbuf, int n) { drm_clip_rect_t box; int nr; @@ -131,7 +131,7 @@ static int r300_emit_cliprects(drm_radeon_private_t * dev_priv, return 0; } -u8 r300_reg_flags[0x10000 >> 2]; +static u8 r300_reg_flags[0x10000 >> 2]; void r300_init_reg_flags(void) { @@ -260,7 +260,7 @@ static __inline__ int r300_check_offset(drm_radeon_private_t * dev_priv, static __inline__ int r300_emit_carefully_checked_packet0(drm_radeon_private_t * dev_priv, - drm_radeon_cmd_buffer_t + drm_radeon_kcmd_buffer_t * cmdbuf, drm_r300_cmd_header_t header) @@ -281,7 +281,7 @@ static __inline__ int r300_emit_carefully_checked_packet0(drm_radeon_private_t * return DRM_ERR(EINVAL); } for (i = 0; i < sz; i++) { - values[i] = ((int __user *)cmdbuf->buf)[i]; + values[i] = ((int *)cmdbuf->buf)[i]; switch (r300_reg_flags[(reg >> 2) + i]) { case MARK_SAFE: break; @@ -318,7 +318,7 @@ static __inline__ int r300_emit_carefully_checked_packet0(drm_radeon_private_t * * Note that checks are performed on contents and addresses of the registers */ static __inline__ int r300_emit_packet0(drm_radeon_private_t * dev_priv, - drm_radeon_cmd_buffer_t * cmdbuf, + drm_radeon_kcmd_buffer_t * cmdbuf, drm_r300_cmd_header_t header) { int reg; @@ -349,7 +349,7 @@ static __inline__ int r300_emit_packet0(drm_radeon_private_t * dev_priv, BEGIN_RING(1 + sz); OUT_RING(CP_PACKET0(reg, sz - 1)); - OUT_RING_TABLE((int __user *)cmdbuf->buf, sz); + OUT_RING_TABLE((int *)cmdbuf->buf, sz); ADVANCE_RING(); cmdbuf->buf += sz * 4; @@ -364,7 +364,7 @@ static __inline__ int r300_emit_packet0(drm_radeon_private_t * dev_priv, * Called by r300_do_cp_cmdbuf. */ static __inline__ int r300_emit_vpu(drm_radeon_private_t * dev_priv, - drm_radeon_cmd_buffer_t * cmdbuf, + drm_radeon_kcmd_buffer_t * cmdbuf, drm_r300_cmd_header_t header) { int sz; @@ -386,7 +386,7 @@ static __inline__ int r300_emit_vpu(drm_radeon_private_t * dev_priv, OUT_RING_REG(R300_VAP_PVS_WAITIDLE, 0); OUT_RING_REG(R300_VAP_PVS_UPLOAD_ADDRESS, addr); OUT_RING(CP_PACKET0_TABLE(R300_VAP_PVS_UPLOAD_DATA, sz * 4 - 1)); - OUT_RING_TABLE((int __user *)cmdbuf->buf, sz * 4); + OUT_RING_TABLE((int *)cmdbuf->buf, sz * 4); ADVANCE_RING(); @@ -401,7 +401,7 @@ static __inline__ int r300_emit_vpu(drm_radeon_private_t * dev_priv, * Called by r300_emit_packet3. */ static __inline__ int r300_emit_clear(drm_radeon_private_t * dev_priv, - drm_radeon_cmd_buffer_t * cmdbuf) + drm_radeon_kcmd_buffer_t * cmdbuf) { RING_LOCALS; @@ -412,7 +412,7 @@ static __inline__ int r300_emit_clear(drm_radeon_private_t * dev_priv, OUT_RING(CP_PACKET3(R200_3D_DRAW_IMMD_2, 8)); OUT_RING(R300_PRIM_TYPE_POINT | R300_PRIM_WALK_RING | (1 << R300_PRIM_NUM_VERTICES_SHIFT)); - OUT_RING_TABLE((int __user *)cmdbuf->buf, 8); + OUT_RING_TABLE((int *)cmdbuf->buf, 8); ADVANCE_RING(); cmdbuf->buf += 8 * 4; @@ -422,7 +422,7 @@ static __inline__ int r300_emit_clear(drm_radeon_private_t * dev_priv, } static __inline__ int r300_emit_3d_load_vbpntr(drm_radeon_private_t * dev_priv, - drm_radeon_cmd_buffer_t * cmdbuf, + drm_radeon_kcmd_buffer_t * cmdbuf, u32 header) { int count, i, k; @@ -490,7 +490,7 @@ static __inline__ int r300_emit_3d_load_vbpntr(drm_radeon_private_t * dev_priv, } static __inline__ int r300_emit_raw_packet3(drm_radeon_private_t * dev_priv, - drm_radeon_cmd_buffer_t * cmdbuf) + drm_radeon_kcmd_buffer_t * cmdbuf) { u32 header; int count; @@ -503,7 +503,7 @@ static __inline__ int r300_emit_raw_packet3(drm_radeon_private_t * dev_priv, We need to be smarter. */ /* obtain first word - actual packet3 header */ - header = *(u32 __user *) cmdbuf->buf; + header = *(u32 *) cmdbuf->buf; /* Is it packet 3 ? */ if ((header >> 30) != 0x3) { @@ -541,7 +541,7 @@ static __inline__ int r300_emit_raw_packet3(drm_radeon_private_t * dev_priv, BEGIN_RING(count + 2); OUT_RING(header); - OUT_RING_TABLE((int __user *)(cmdbuf->buf + 4), count + 1); + OUT_RING_TABLE((int *)(cmdbuf->buf + 4), count + 1); ADVANCE_RING(); cmdbuf->buf += (count + 2) * 4; @@ -555,12 +555,12 @@ static __inline__ int r300_emit_raw_packet3(drm_radeon_private_t * dev_priv, * Called by r300_do_cp_cmdbuf. */ static __inline__ int r300_emit_packet3(drm_radeon_private_t * dev_priv, - drm_radeon_cmd_buffer_t * cmdbuf, + drm_radeon_kcmd_buffer_t * cmdbuf, drm_r300_cmd_header_t header) { int n; int ret; - char __user *orig_buf = cmdbuf->buf; + char *orig_buf = cmdbuf->buf; int orig_bufsz = cmdbuf->bufsz; /* This is a do-while-loop so that we run the interior at least once, @@ -659,7 +659,7 @@ static void r300_discard_buffer(drm_device_t * dev, drm_buf_t * buf) */ int r300_do_cp_cmdbuf(drm_device_t * dev, DRMFILE filp, - drm_file_t * filp_priv, drm_radeon_cmd_buffer_t * cmdbuf) + drm_file_t * filp_priv, drm_radeon_kcmd_buffer_t * cmdbuf) { drm_radeon_private_t *dev_priv = dev->dev_private; drm_device_dma_t *dma = dev->dma; -- cgit v1.2.2