DRM_COPY_TO_USER_IOCTL((drm_via_cmdbuf_size_t *) data, d_siz, 
DRM_COPY_TO_USER_IOCTL((drm_via_cmdbuf_size_t __user *) data, d_siz, 
via_cmdbuf_size(DRM_IOCTL_ARGS){	DRM_DEVICE;	drm_via_cmdbuf_size_t d_siz;	int ret = 0;	uint32_t tmp_size, count;	drm_via_private_t *dev_priv;	DRM_DEBUG("via cmdbuf_size\n");	LOCK_TEST_WITH_RETURN( dev, filp );	dev_priv = (drm_via_private_t *) dev->dev_private;	if (dev_priv->ring.virtual_start == NULL) {		DRM_ERROR("%s called without initializing AGP ring buffer.\n",			  __FUNCTION__);		return DRM_ERR(EFAULT);	}	DRM_COPY_FROM_USER_IOCTL(d_siz, (drm_via_cmdbuf_size_t *) data,				 sizeof(d_siz));	count = 1000000;	tmp_size = d_siz.size;	switch(d_siz.func) {	case VIA_CMDBUF_SPACE:		while (((tmp_size = via_cmdbuf_space(dev_priv)) < d_siz.size) && count--) {			if (!d_siz.wait) {				break;			}		}		if (!count) {			DRM_ERROR("VIA_CMDBUF_SPACE timed out.\n");			ret = DRM_ERR(EAGAIN);		}		break;	case VIA_CMDBUF_LAG:		while (((tmp_size = via_cmdbuf_lag(dev_priv)) > d_siz.size) && count--) {			if (!d_siz.wait) {				break;			}		}		if (!count) {			DRM_ERROR("VIA_CMDBUF_LAG timed out.\n");			ret = DRM_ERR(EAGAIN);		}		break;	default:		ret = DRM_ERR(EFAULT);	}	d_siz.size = tmp_size;	DRM_COPY_TO_USER_IOCTL((drm_via_cmdbuf_size_t *) data, d_siz,			       sizeof(d_siz));	return ret;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/bbaf364103cee15c895e2086723d0ad9ef47ae99/via_dma.c/buggy/drivers/char/drm/via_dma.c