Add missing DRM_ERR()s.

main
Eric Anholt 2004-05-11 04:23:02 +00:00
parent a1160ba279
commit 485b259b44
6 changed files with 16 additions and 16 deletions

View File

@ -680,7 +680,7 @@ static int mach64_do_dma_init( drm_device_t *dev, drm_mach64_init_t *init )
DRM_ERROR( "can not find ring map!\n" );
dev->dev_private = (void *)dev_priv;
mach64_do_cleanup_dma(dev);
return -EINVAL;
return DRM_ERR(EINVAL);
}
DRM_IOREMAP( dev_priv->ring_map, dev );
if ( !dev_priv->ring_map->handle ) {
@ -688,7 +688,7 @@ static int mach64_do_dma_init( drm_device_t *dev, drm_mach64_init_t *init )
" descriptor ring\n" );
dev->dev_private = (void *) dev_priv;
mach64_do_cleanup_dma( dev );
return -ENOMEM;
return DRM_ERR(ENOMEM);
}
DRM_FIND_MAP( dev_priv->buffers, init->buffers_offset );
if ( !dev_priv->buffers ) {

View File

@ -916,7 +916,7 @@ static int r128_cce_dispatch_write_span( drm_device_t *dev,
count = depth->n;
if (count > 4096 || count <= 0)
return -EMSGSIZE;
return DRM_ERR(EMSGSIZE);
if ( DRM_COPY_FROM_USER( &x, depth->x, sizeof(x) ) ) {
return DRM_ERR(EFAULT);
@ -1012,7 +1012,7 @@ static int r128_cce_dispatch_write_pixels( drm_device_t *dev,
count = depth->n;
if (count > 4096 || count <= 0)
return -EMSGSIZE;
return DRM_ERR(EMSGSIZE);
xbuf_size = count * sizeof(*x);
ybuf_size = count * sizeof(*y);
@ -1131,7 +1131,7 @@ static int r128_cce_dispatch_read_span( drm_device_t *dev,
count = depth->n;
if (count > 4096 || count <= 0)
return -EMSGSIZE;
return DRM_ERR(EMSGSIZE);
if ( DRM_COPY_FROM_USER( &x, depth->x, sizeof(x) ) ) {
return DRM_ERR(EFAULT);
@ -1176,7 +1176,7 @@ static int r128_cce_dispatch_read_pixels( drm_device_t *dev,
count = depth->n;
if (count > 4096 || count <= 0)
return -EMSGSIZE;
return DRM_ERR(EMSGSIZE);
if ( count > dev_priv->depth_pitch ) {
count = dev_priv->depth_pitch;

View File

@ -137,12 +137,12 @@ static int init_heap(struct mem_block **heap, int start, int size)
struct mem_block *blocks = DRM_MALLOC(sizeof(*blocks));
if (!blocks)
return -ENOMEM;
return DRM_ERR(ENOMEM);
*heap = DRM_MALLOC(sizeof(**heap));
if (!*heap) {
DRM_FREE( blocks, sizeof(*blocks) );
return -ENOMEM;
return DRM_ERR(ENOMEM);
}
blocks->start = start;

View File

@ -680,7 +680,7 @@ static int mach64_do_dma_init( drm_device_t *dev, drm_mach64_init_t *init )
DRM_ERROR( "can not find ring map!\n" );
dev->dev_private = (void *)dev_priv;
mach64_do_cleanup_dma(dev);
return -EINVAL;
return DRM_ERR(EINVAL);
}
DRM_IOREMAP( dev_priv->ring_map, dev );
if ( !dev_priv->ring_map->handle ) {
@ -688,7 +688,7 @@ static int mach64_do_dma_init( drm_device_t *dev, drm_mach64_init_t *init )
" descriptor ring\n" );
dev->dev_private = (void *) dev_priv;
mach64_do_cleanup_dma( dev );
return -ENOMEM;
return DRM_ERR(ENOMEM);
}
DRM_FIND_MAP( dev_priv->buffers, init->buffers_offset );
if ( !dev_priv->buffers ) {

View File

@ -916,7 +916,7 @@ static int r128_cce_dispatch_write_span( drm_device_t *dev,
count = depth->n;
if (count > 4096 || count <= 0)
return -EMSGSIZE;
return DRM_ERR(EMSGSIZE);
if ( DRM_COPY_FROM_USER( &x, depth->x, sizeof(x) ) ) {
return DRM_ERR(EFAULT);
@ -1012,7 +1012,7 @@ static int r128_cce_dispatch_write_pixels( drm_device_t *dev,
count = depth->n;
if (count > 4096 || count <= 0)
return -EMSGSIZE;
return DRM_ERR(EMSGSIZE);
xbuf_size = count * sizeof(*x);
ybuf_size = count * sizeof(*y);
@ -1131,7 +1131,7 @@ static int r128_cce_dispatch_read_span( drm_device_t *dev,
count = depth->n;
if (count > 4096 || count <= 0)
return -EMSGSIZE;
return DRM_ERR(EMSGSIZE);
if ( DRM_COPY_FROM_USER( &x, depth->x, sizeof(x) ) ) {
return DRM_ERR(EFAULT);
@ -1176,7 +1176,7 @@ static int r128_cce_dispatch_read_pixels( drm_device_t *dev,
count = depth->n;
if (count > 4096 || count <= 0)
return -EMSGSIZE;
return DRM_ERR(EMSGSIZE);
if ( count > dev_priv->depth_pitch ) {
count = dev_priv->depth_pitch;

View File

@ -137,12 +137,12 @@ static int init_heap(struct mem_block **heap, int start, int size)
struct mem_block *blocks = DRM_MALLOC(sizeof(*blocks));
if (!blocks)
return -ENOMEM;
return DRM_ERR(ENOMEM);
*heap = DRM_MALLOC(sizeof(**heap));
if (!*heap) {
DRM_FREE( blocks, sizeof(*blocks) );
return -ENOMEM;
return DRM_ERR(ENOMEM);
}
blocks->start = start;