summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2002-09-17 13:16:26 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2002-09-17 13:16:26 +0000
commit555a03c150b69033129889d30917ef18b01f6f13 (patch)
treed095748ae05bdb9957b83fe6e3e2f0b1a6aa8b47
parent1bd94607331e0d19e5fbdb92cc8ddb21d84ac713 (diff)
kfree --> DRM_FREE remove print statements
-rw-r--r--shared-core/radeon_mem.c35
-rw-r--r--shared/radeon_mem.c35
2 files changed, 14 insertions, 56 deletions
diff --git a/shared-core/radeon_mem.c b/shared-core/radeon_mem.c
index dc3da797..3b122bca 100644
--- a/shared-core/radeon_mem.c
+++ b/shared-core/radeon_mem.c
@@ -118,7 +118,7 @@ static void free_block( struct mem_block *p )
p->size += q->size;
p->next = q->next;
p->next->prev = p;
- kfree(p);
+ DRM_FREE(p);
}
if (p->prev->pid == 0) {
@@ -126,7 +126,7 @@ static void free_block( struct mem_block *p )
q->size += p->size;
q->next = p->next;
q->next->prev = q;
- kfree(p);
+ DRM_FREE(p);
}
}
@@ -151,7 +151,7 @@ static int init_heap(struct mem_block **heap, int start, int size)
*heap = DRM_MALLOC(sizeof(**heap));
if (!*heap) {
- kfree( blocks );
+ DRM_FREE( blocks );
return -ENOMEM;
}
@@ -174,19 +174,11 @@ void radeon_mem_release( struct mem_block *heap )
int pid = DRM_CURRENTPID;
struct mem_block *p;
- printk("%s\n", __FUNCTION__);
-
for (p = heap->next ; p != heap ; p = p->next) {
- if (p->pid == pid) {
- printk("%s free 0x%x owner %d\n", __FUNCTION__,
- p->start, p->pid);
+ if (p->pid == pid)
p->pid = 0;
- }
}
- printk("%s stage 1:\n", __FUNCTION__);
- print_heap(heap);
-
/* Assumes a single contiguous range. Needs a special pid in
* 'heap' to stop it being subsumed.
*/
@@ -196,12 +188,9 @@ void radeon_mem_release( struct mem_block *heap )
p->size += q->size;
p->next = q->next;
p->next->prev = p;
- kfree(q);
+ DRM_FREE(q);
}
}
-
- printk("%s stage 2:\n", __FUNCTION__);
- print_heap(heap);
}
/* Shutdown.
@@ -213,10 +202,10 @@ void radeon_mem_takedown( struct mem_block **heap )
for (p = (*heap)->next ; p != *heap ; ) {
struct mem_block *q = p;
p = p->next;
- kfree(q);
+ DRM_FREE(q);
}
- kfree( *heap );
+ DRM_FREE( *heap );
*heap = 0;
}
@@ -244,8 +233,6 @@ int radeon_mem_alloc( DRM_IOCTL_ARGS )
drm_radeon_mem_alloc_t alloc;
struct mem_block *block, **heap;
- printk("%s\n", __FUNCTION__);
-
if ( !dev_priv ) {
DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ );
return DRM_ERR(EINVAL);
@@ -270,10 +257,6 @@ int radeon_mem_alloc( DRM_IOCTL_ARGS )
if (!block)
return DRM_ERR(ENOMEM);
- printk("%s start 0x%x size 0x%x\n", __FUNCTION__,
- block->start, block->size);
- print_heap(*heap);
-
if ( DRM_COPY_TO_USER( alloc.region_offset, &block->start,
sizeof(int) ) ) {
DRM_ERROR( "copy_to_user\n" );
@@ -292,8 +275,6 @@ int radeon_mem_free( DRM_IOCTL_ARGS )
drm_radeon_mem_free_t memfree;
struct mem_block *block, **heap;
- printk("%s\n", __FUNCTION__);
-
if ( !dev_priv ) {
DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ );
return DRM_ERR(EINVAL);
@@ -324,8 +305,6 @@ int radeon_mem_init_heap( DRM_IOCTL_ARGS )
drm_radeon_mem_init_heap_t initheap;
struct mem_block **heap;
- printk("%s\n", __FUNCTION__);
-
if ( !dev_priv ) {
DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ );
return DRM_ERR(EINVAL);
diff --git a/shared/radeon_mem.c b/shared/radeon_mem.c
index dc3da797..3b122bca 100644
--- a/shared/radeon_mem.c
+++ b/shared/radeon_mem.c
@@ -118,7 +118,7 @@ static void free_block( struct mem_block *p )
p->size += q->size;
p->next = q->next;
p->next->prev = p;
- kfree(p);
+ DRM_FREE(p);
}
if (p->prev->pid == 0) {
@@ -126,7 +126,7 @@ static void free_block( struct mem_block *p )
q->size += p->size;
q->next = p->next;
q->next->prev = q;
- kfree(p);
+ DRM_FREE(p);
}
}
@@ -151,7 +151,7 @@ static int init_heap(struct mem_block **heap, int start, int size)
*heap = DRM_MALLOC(sizeof(**heap));
if (!*heap) {
- kfree( blocks );
+ DRM_FREE( blocks );
return -ENOMEM;
}
@@ -174,19 +174,11 @@ void radeon_mem_release( struct mem_block *heap )
int pid = DRM_CURRENTPID;
struct mem_block *p;
- printk("%s\n", __FUNCTION__);
-
for (p = heap->next ; p != heap ; p = p->next) {
- if (p->pid == pid) {
- printk("%s free 0x%x owner %d\n", __FUNCTION__,
- p->start, p->pid);
+ if (p->pid == pid)
p->pid = 0;
- }
}
- printk("%s stage 1:\n", __FUNCTION__);
- print_heap(heap);
-
/* Assumes a single contiguous range. Needs a special pid in
* 'heap' to stop it being subsumed.
*/
@@ -196,12 +188,9 @@ void radeon_mem_release( struct mem_block *heap )
p->size += q->size;
p->next = q->next;
p->next->prev = p;
- kfree(q);
+ DRM_FREE(q);
}
}
-
- printk("%s stage 2:\n", __FUNCTION__);
- print_heap(heap);
}
/* Shutdown.
@@ -213,10 +202,10 @@ void radeon_mem_takedown( struct mem_block **heap )
for (p = (*heap)->next ; p != *heap ; ) {
struct mem_block *q = p;
p = p->next;
- kfree(q);
+ DRM_FREE(q);
}
- kfree( *heap );
+ DRM_FREE( *heap );
*heap = 0;
}
@@ -244,8 +233,6 @@ int radeon_mem_alloc( DRM_IOCTL_ARGS )
drm_radeon_mem_alloc_t alloc;
struct mem_block *block, **heap;
- printk("%s\n", __FUNCTION__);
-
if ( !dev_priv ) {
DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ );
return DRM_ERR(EINVAL);
@@ -270,10 +257,6 @@ int radeon_mem_alloc( DRM_IOCTL_ARGS )
if (!block)
return DRM_ERR(ENOMEM);
- printk("%s start 0x%x size 0x%x\n", __FUNCTION__,
- block->start, block->size);
- print_heap(*heap);
-
if ( DRM_COPY_TO_USER( alloc.region_offset, &block->start,
sizeof(int) ) ) {
DRM_ERROR( "copy_to_user\n" );
@@ -292,8 +275,6 @@ int radeon_mem_free( DRM_IOCTL_ARGS )
drm_radeon_mem_free_t memfree;
struct mem_block *block, **heap;
- printk("%s\n", __FUNCTION__);
-
if ( !dev_priv ) {
DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ );
return DRM_ERR(EINVAL);
@@ -324,8 +305,6 @@ int radeon_mem_init_heap( DRM_IOCTL_ARGS )
drm_radeon_mem_init_heap_t initheap;
struct mem_block **heap;
- printk("%s\n", __FUNCTION__);
-
if ( !dev_priv ) {
DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ );
return DRM_ERR(EINVAL);