From: Dave Airlie Date: Mon, 24 Oct 2005 08:41:39 +0000 (+1000) Subject: drm: fix warning on 64-bit platforms.. X-Git-Tag: v2.6.15-rc1~18^2~14^2~1 X-Git-Url: http://ftp.safe.ca/?p=safe%2Fjmp%2Flinux-2.6;a=commitdiff_plain;h=67e1a014fbc0e472ccc55766a63640a767ede3bf drm: fix warning on 64-bit platforms.. This looks ugly, but it is the only thing that makes sense that doesn't change the API. Signed-off-by: Dave Airlie --- diff --git a/drivers/char/drm/drm_bufs.c b/drivers/char/drm/drm_bufs.c index 58e513a..319bdea 100644 --- a/drivers/char/drm/drm_bufs.c +++ b/drivers/char/drm/drm_bufs.c @@ -309,7 +309,9 @@ int drm_addmap_ioctl(struct inode *inode, struct file *filp, if (copy_to_user(argp, maplist->map, sizeof(drm_map_t))) return -EFAULT; - if (put_user((void *)maplist->user_token, &argp->handle)) + + /* avoid a warning on 64-bit, this casting isn't very nice, but the API is set so too late */ + if (put_user((void *)(unsigned long)maplist->user_token, &argp->handle)) return -EFAULT; return 0; }