summaryrefslogtreecommitdiff
path: root/sys/dev/pci/drm/sis_ds.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/pci/drm/sis_ds.c')
-rw-r--r--sys/dev/pci/drm/sis_ds.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/sys/dev/pci/drm/sis_ds.c b/sys/dev/pci/drm/sis_ds.c
index 2e485d48294..959ddd96927 100644
--- a/sys/dev/pci/drm/sis_ds.c
+++ b/sys/dev/pci/drm/sis_ds.c
@@ -41,7 +41,7 @@ set_t *setInit(void)
int i;
set_t *set;
- set = (set_t *) drm_alloc(sizeof(set_t), DRM_MEM_DRIVER);
+ set = drm_alloc(sizeof(*set));
if (set != NULL) {
for (i = 0; i < SET_SIZE; i++) {
set->list[i].free_next = i + 1;
@@ -127,7 +127,7 @@ int setNext(set_t * set, ITEM_TYPE * item)
int setDestroy(set_t * set)
{
- drm_free(set, sizeof(set_t), DRM_MEM_DRIVER);
+ drm_free(set);
return 1;
}
@@ -165,7 +165,7 @@ memHeap_t *mmInit(int ofs, int size)
if (size <= 0)
return NULL;
- blocks = (TMemBlock *) drm_calloc(1, sizeof(TMemBlock), DRM_MEM_DRIVER);
+ blocks = drm_calloc(1, sizeof(*blocks));
if (blocks != NULL) {
blocks->ofs = ofs;
blocks->size = size;
@@ -201,8 +201,7 @@ static TMemBlock *SliceBlock(TMemBlock * p,
/* break left */
if (startofs > p->ofs) {
- newblock = (TMemBlock *) drm_calloc(1, sizeof(TMemBlock),
- DRM_MEM_DRIVER);
+ newblock = drm_calloc(1, sizeof(*newblock));
newblock->ofs = startofs;
newblock->size = p->size - (startofs - p->ofs);
newblock->free = 1;
@@ -214,8 +213,7 @@ static TMemBlock *SliceBlock(TMemBlock * p,
/* break right */
if (size < p->size) {
- newblock = (TMemBlock *) drm_calloc(1, sizeof(TMemBlock),
- DRM_MEM_DRIVER);
+ newblock = drm_calloc(1, sizeof(*newblock));
newblock->ofs = startofs + size;
newblock->size = p->size - size;
newblock->free = 1;
@@ -267,7 +265,7 @@ static __inline__ int Join2Blocks(TMemBlock * p)
TMemBlock *q = p->next;
p->size += q->size;
p->next = q->next;
- drm_free(q, sizeof(TMemBlock), DRM_MEM_DRIVER);
+ drm_free(q);
return 1;
}
return 0;