sparse cleanups from kernel: Al Viro
parent
bb5112b616
commit
8efddd01e8
|
@ -126,7 +126,7 @@ int DRM(addmap)( struct inode *inode, struct file *filp,
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
map->mtrr = -1;
|
map->mtrr = -1;
|
||||||
map->handle = 0;
|
map->handle = NULL;
|
||||||
|
|
||||||
switch ( map->type ) {
|
switch ( map->type ) {
|
||||||
case _DRM_REGISTERS:
|
case _DRM_REGISTERS:
|
||||||
|
@ -469,7 +469,7 @@ int DRM(addbufs_agp)( struct inode *inode, struct file *filp,
|
||||||
buf->waiting = 0;
|
buf->waiting = 0;
|
||||||
buf->pending = 0;
|
buf->pending = 0;
|
||||||
init_waitqueue_head( &buf->dma_wait );
|
init_waitqueue_head( &buf->dma_wait );
|
||||||
buf->filp = 0;
|
buf->filp = NULL;
|
||||||
|
|
||||||
buf->dev_priv_size = sizeof(DRIVER_BUF_PRIV_T);
|
buf->dev_priv_size = sizeof(DRIVER_BUF_PRIV_T);
|
||||||
buf->dev_private = DRM(alloc)( sizeof(DRIVER_BUF_PRIV_T),
|
buf->dev_private = DRM(alloc)( sizeof(DRIVER_BUF_PRIV_T),
|
||||||
|
@ -693,7 +693,7 @@ int DRM(addbufs_pci)( struct inode *inode, struct file *filp,
|
||||||
buf->waiting = 0;
|
buf->waiting = 0;
|
||||||
buf->pending = 0;
|
buf->pending = 0;
|
||||||
init_waitqueue_head( &buf->dma_wait );
|
init_waitqueue_head( &buf->dma_wait );
|
||||||
buf->filp = 0;
|
buf->filp = NULL;
|
||||||
|
|
||||||
buf->dev_priv_size = sizeof(DRIVER_BUF_PRIV_T);
|
buf->dev_priv_size = sizeof(DRIVER_BUF_PRIV_T);
|
||||||
buf->dev_private = DRM(alloc)( sizeof(DRIVER_BUF_PRIV_T),
|
buf->dev_private = DRM(alloc)( sizeof(DRIVER_BUF_PRIV_T),
|
||||||
|
|
|
@ -545,7 +545,7 @@ static int DRM(takedown)( drm_device_t *dev )
|
||||||
#endif
|
#endif
|
||||||
if ( dev->lock.hw_lock ) {
|
if ( dev->lock.hw_lock ) {
|
||||||
dev->sigdata.lock = dev->lock.hw_lock = NULL; /* SHM removed */
|
dev->sigdata.lock = dev->lock.hw_lock = NULL; /* SHM removed */
|
||||||
dev->lock.filp = 0;
|
dev->lock.filp = NULL;
|
||||||
wake_up_interruptible( &dev->lock.lock_queue );
|
wake_up_interruptible( &dev->lock.lock_queue );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -126,7 +126,7 @@ int DRM(addmap)( struct inode *inode, struct file *filp,
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
map->mtrr = -1;
|
map->mtrr = -1;
|
||||||
map->handle = 0;
|
map->handle = NULL;
|
||||||
|
|
||||||
switch ( map->type ) {
|
switch ( map->type ) {
|
||||||
case _DRM_REGISTERS:
|
case _DRM_REGISTERS:
|
||||||
|
@ -469,7 +469,7 @@ int DRM(addbufs_agp)( struct inode *inode, struct file *filp,
|
||||||
buf->waiting = 0;
|
buf->waiting = 0;
|
||||||
buf->pending = 0;
|
buf->pending = 0;
|
||||||
init_waitqueue_head( &buf->dma_wait );
|
init_waitqueue_head( &buf->dma_wait );
|
||||||
buf->filp = 0;
|
buf->filp = NULL;
|
||||||
|
|
||||||
buf->dev_priv_size = sizeof(DRIVER_BUF_PRIV_T);
|
buf->dev_priv_size = sizeof(DRIVER_BUF_PRIV_T);
|
||||||
buf->dev_private = DRM(alloc)( sizeof(DRIVER_BUF_PRIV_T),
|
buf->dev_private = DRM(alloc)( sizeof(DRIVER_BUF_PRIV_T),
|
||||||
|
@ -693,7 +693,7 @@ int DRM(addbufs_pci)( struct inode *inode, struct file *filp,
|
||||||
buf->waiting = 0;
|
buf->waiting = 0;
|
||||||
buf->pending = 0;
|
buf->pending = 0;
|
||||||
init_waitqueue_head( &buf->dma_wait );
|
init_waitqueue_head( &buf->dma_wait );
|
||||||
buf->filp = 0;
|
buf->filp = NULL;
|
||||||
|
|
||||||
buf->dev_priv_size = sizeof(DRIVER_BUF_PRIV_T);
|
buf->dev_priv_size = sizeof(DRIVER_BUF_PRIV_T);
|
||||||
buf->dev_private = DRM(alloc)( sizeof(DRIVER_BUF_PRIV_T),
|
buf->dev_private = DRM(alloc)( sizeof(DRIVER_BUF_PRIV_T),
|
||||||
|
|
|
@ -545,7 +545,7 @@ static int DRM(takedown)( drm_device_t *dev )
|
||||||
#endif
|
#endif
|
||||||
if ( dev->lock.hw_lock ) {
|
if ( dev->lock.hw_lock ) {
|
||||||
dev->sigdata.lock = dev->lock.hw_lock = NULL; /* SHM removed */
|
dev->sigdata.lock = dev->lock.hw_lock = NULL; /* SHM removed */
|
||||||
dev->lock.filp = 0;
|
dev->lock.filp = NULL;
|
||||||
wake_up_interruptible( &dev->lock.lock_queue );
|
wake_up_interruptible( &dev->lock.lock_queue );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ static struct mem_block *split_block(struct mem_block *p, int start, int size,
|
||||||
goto out;
|
goto out;
|
||||||
newblock->start = start;
|
newblock->start = start;
|
||||||
newblock->size = p->size - (start - p->start);
|
newblock->size = p->size - (start - p->start);
|
||||||
newblock->filp = 0;
|
newblock->filp = NULL;
|
||||||
newblock->next = p->next;
|
newblock->next = p->next;
|
||||||
newblock->prev = p;
|
newblock->prev = p;
|
||||||
p->next->prev = newblock;
|
p->next->prev = newblock;
|
||||||
|
@ -65,7 +65,7 @@ static struct mem_block *split_block(struct mem_block *p, int start, int size,
|
||||||
goto out;
|
goto out;
|
||||||
newblock->start = start + size;
|
newblock->start = start + size;
|
||||||
newblock->size = p->size - size;
|
newblock->size = p->size - size;
|
||||||
newblock->filp = 0;
|
newblock->filp = NULL;
|
||||||
newblock->next = p->next;
|
newblock->next = p->next;
|
||||||
newblock->prev = p;
|
newblock->prev = p;
|
||||||
p->next->prev = newblock;
|
p->next->prev = newblock;
|
||||||
|
@ -108,7 +108,7 @@ static struct mem_block *find_block( struct mem_block *heap, int start )
|
||||||
|
|
||||||
static void free_block( struct mem_block *p )
|
static void free_block( struct mem_block *p )
|
||||||
{
|
{
|
||||||
p->filp = 0;
|
p->filp = NULL;
|
||||||
|
|
||||||
/* Assumes a single contiguous range. Needs a special filp in
|
/* Assumes a single contiguous range. Needs a special filp in
|
||||||
* 'heap' to stop it being subsumed.
|
* 'heap' to stop it being subsumed.
|
||||||
|
@ -147,7 +147,7 @@ static int init_heap(struct mem_block **heap, int start, int size)
|
||||||
|
|
||||||
blocks->start = start;
|
blocks->start = start;
|
||||||
blocks->size = size;
|
blocks->size = size;
|
||||||
blocks->filp = 0;
|
blocks->filp = NULL;
|
||||||
blocks->next = blocks->prev = *heap;
|
blocks->next = blocks->prev = *heap;
|
||||||
|
|
||||||
memset( *heap, 0, sizeof(**heap) );
|
memset( *heap, 0, sizeof(**heap) );
|
||||||
|
@ -168,7 +168,7 @@ void radeon_mem_release( DRMFILE filp, struct mem_block *heap )
|
||||||
|
|
||||||
for (p = heap->next ; p != heap ; p = p->next) {
|
for (p = heap->next ; p != heap ; p = p->next) {
|
||||||
if (p->filp == filp)
|
if (p->filp == filp)
|
||||||
p->filp = 0;
|
p->filp = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Assumes a single contiguous range. Needs a special filp in
|
/* Assumes a single contiguous range. Needs a special filp in
|
||||||
|
@ -201,7 +201,7 @@ void radeon_mem_takedown( struct mem_block **heap )
|
||||||
}
|
}
|
||||||
|
|
||||||
DRM_FREE( *heap, sizeof(**heap) );
|
DRM_FREE( *heap, sizeof(**heap) );
|
||||||
*heap = 0;
|
*heap = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -217,7 +217,7 @@ static struct mem_block **get_heap( drm_radeon_private_t *dev_priv,
|
||||||
case RADEON_MEM_REGION_FB:
|
case RADEON_MEM_REGION_FB:
|
||||||
return &dev_priv->fb_heap;
|
return &dev_priv->fb_heap;
|
||||||
default:
|
default:
|
||||||
return 0;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2310,7 +2310,7 @@ int radeon_cp_cmdbuf( DRM_IOCTL_ARGS )
|
||||||
drm_radeon_private_t *dev_priv = dev->dev_private;
|
drm_radeon_private_t *dev_priv = dev->dev_private;
|
||||||
drm_file_t *filp_priv;
|
drm_file_t *filp_priv;
|
||||||
drm_device_dma_t *dma = dev->dma;
|
drm_device_dma_t *dma = dev->dma;
|
||||||
drm_buf_t *buf = 0;
|
drm_buf_t *buf = NULL;
|
||||||
int idx;
|
int idx;
|
||||||
drm_radeon_cmd_buffer_t cmdbuf;
|
drm_radeon_cmd_buffer_t cmdbuf;
|
||||||
drm_radeon_cmd_header_t header;
|
drm_radeon_cmd_header_t header;
|
||||||
|
|
|
@ -165,7 +165,7 @@ memHeap_t *mmInit(int ofs,
|
||||||
PMemBlock blocks;
|
PMemBlock blocks;
|
||||||
|
|
||||||
if (size <= 0)
|
if (size <= 0)
|
||||||
return 0;
|
return NULL;
|
||||||
|
|
||||||
blocks = (TMemBlock *)DRM(calloc)(1, sizeof(TMemBlock), DRM_MEM_DRIVER);
|
blocks = (TMemBlock *)DRM(calloc)(1, sizeof(TMemBlock), DRM_MEM_DRIVER);
|
||||||
if (blocks != NULL) {
|
if (blocks != NULL) {
|
||||||
|
@ -174,7 +174,7 @@ memHeap_t *mmInit(int ofs,
|
||||||
blocks->free = 1;
|
blocks->free = 1;
|
||||||
return (memHeap_t *)blocks;
|
return (memHeap_t *)blocks;
|
||||||
} else
|
} else
|
||||||
return 0;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Checks if a pointer 'b' is part of the heap 'heap' */
|
/* Checks if a pointer 'b' is part of the heap 'heap' */
|
||||||
|
|
|
@ -49,7 +49,7 @@ static struct mem_block *split_block(struct mem_block *p, int start, int size,
|
||||||
goto out;
|
goto out;
|
||||||
newblock->start = start;
|
newblock->start = start;
|
||||||
newblock->size = p->size - (start - p->start);
|
newblock->size = p->size - (start - p->start);
|
||||||
newblock->filp = 0;
|
newblock->filp = NULL;
|
||||||
newblock->next = p->next;
|
newblock->next = p->next;
|
||||||
newblock->prev = p;
|
newblock->prev = p;
|
||||||
p->next->prev = newblock;
|
p->next->prev = newblock;
|
||||||
|
@ -65,7 +65,7 @@ static struct mem_block *split_block(struct mem_block *p, int start, int size,
|
||||||
goto out;
|
goto out;
|
||||||
newblock->start = start + size;
|
newblock->start = start + size;
|
||||||
newblock->size = p->size - size;
|
newblock->size = p->size - size;
|
||||||
newblock->filp = 0;
|
newblock->filp = NULL;
|
||||||
newblock->next = p->next;
|
newblock->next = p->next;
|
||||||
newblock->prev = p;
|
newblock->prev = p;
|
||||||
p->next->prev = newblock;
|
p->next->prev = newblock;
|
||||||
|
@ -108,7 +108,7 @@ static struct mem_block *find_block( struct mem_block *heap, int start )
|
||||||
|
|
||||||
static void free_block( struct mem_block *p )
|
static void free_block( struct mem_block *p )
|
||||||
{
|
{
|
||||||
p->filp = 0;
|
p->filp = NULL;
|
||||||
|
|
||||||
/* Assumes a single contiguous range. Needs a special filp in
|
/* Assumes a single contiguous range. Needs a special filp in
|
||||||
* 'heap' to stop it being subsumed.
|
* 'heap' to stop it being subsumed.
|
||||||
|
@ -147,7 +147,7 @@ static int init_heap(struct mem_block **heap, int start, int size)
|
||||||
|
|
||||||
blocks->start = start;
|
blocks->start = start;
|
||||||
blocks->size = size;
|
blocks->size = size;
|
||||||
blocks->filp = 0;
|
blocks->filp = NULL;
|
||||||
blocks->next = blocks->prev = *heap;
|
blocks->next = blocks->prev = *heap;
|
||||||
|
|
||||||
memset( *heap, 0, sizeof(**heap) );
|
memset( *heap, 0, sizeof(**heap) );
|
||||||
|
@ -168,7 +168,7 @@ void radeon_mem_release( DRMFILE filp, struct mem_block *heap )
|
||||||
|
|
||||||
for (p = heap->next ; p != heap ; p = p->next) {
|
for (p = heap->next ; p != heap ; p = p->next) {
|
||||||
if (p->filp == filp)
|
if (p->filp == filp)
|
||||||
p->filp = 0;
|
p->filp = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Assumes a single contiguous range. Needs a special filp in
|
/* Assumes a single contiguous range. Needs a special filp in
|
||||||
|
@ -201,7 +201,7 @@ void radeon_mem_takedown( struct mem_block **heap )
|
||||||
}
|
}
|
||||||
|
|
||||||
DRM_FREE( *heap, sizeof(**heap) );
|
DRM_FREE( *heap, sizeof(**heap) );
|
||||||
*heap = 0;
|
*heap = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -217,7 +217,7 @@ static struct mem_block **get_heap( drm_radeon_private_t *dev_priv,
|
||||||
case RADEON_MEM_REGION_FB:
|
case RADEON_MEM_REGION_FB:
|
||||||
return &dev_priv->fb_heap;
|
return &dev_priv->fb_heap;
|
||||||
default:
|
default:
|
||||||
return 0;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2310,7 +2310,7 @@ int radeon_cp_cmdbuf( DRM_IOCTL_ARGS )
|
||||||
drm_radeon_private_t *dev_priv = dev->dev_private;
|
drm_radeon_private_t *dev_priv = dev->dev_private;
|
||||||
drm_file_t *filp_priv;
|
drm_file_t *filp_priv;
|
||||||
drm_device_dma_t *dma = dev->dma;
|
drm_device_dma_t *dma = dev->dma;
|
||||||
drm_buf_t *buf = 0;
|
drm_buf_t *buf = NULL;
|
||||||
int idx;
|
int idx;
|
||||||
drm_radeon_cmd_buffer_t cmdbuf;
|
drm_radeon_cmd_buffer_t cmdbuf;
|
||||||
drm_radeon_cmd_header_t header;
|
drm_radeon_cmd_header_t header;
|
||||||
|
|
|
@ -165,7 +165,7 @@ memHeap_t *mmInit(int ofs,
|
||||||
PMemBlock blocks;
|
PMemBlock blocks;
|
||||||
|
|
||||||
if (size <= 0)
|
if (size <= 0)
|
||||||
return 0;
|
return NULL;
|
||||||
|
|
||||||
blocks = (TMemBlock *)DRM(calloc)(1, sizeof(TMemBlock), DRM_MEM_DRIVER);
|
blocks = (TMemBlock *)DRM(calloc)(1, sizeof(TMemBlock), DRM_MEM_DRIVER);
|
||||||
if (blocks != NULL) {
|
if (blocks != NULL) {
|
||||||
|
@ -174,7 +174,7 @@ memHeap_t *mmInit(int ofs,
|
||||||
blocks->free = 1;
|
blocks->free = 1;
|
||||||
return (memHeap_t *)blocks;
|
return (memHeap_t *)blocks;
|
||||||
} else
|
} else
|
||||||
return 0;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Checks if a pointer 'b' is part of the heap 'heap' */
|
/* Checks if a pointer 'b' is part of the heap 'heap' */
|
||||||
|
|
Loading…
Reference in New Issue