diff options
Diffstat (limited to 'vmeta_lib.c')
-rw-r--r-- | vmeta_lib.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/vmeta_lib.c b/vmeta_lib.c index 7fff25b..109e632 100644 --- a/vmeta_lib.c +++ b/vmeta_lib.c @@ -134,19 +134,19 @@ UNSG32 vdec_os_api_get_va(UNSG32 paddr) void vdec_os_api_vfree(void *ptr) { - unsigned int offset = 0; - unsigned int *paddr = NULL; + unsigned int offset; + unsigned int *paddr; - paddr = (unsigned int *)(ptr); + paddr = ptr; offset = *(paddr - 1); paddr = (unsigned int *)((unsigned int)paddr - offset); - free((void *)paddr); + free(paddr); } void *vdec_os_api_vmalloc(UNSG32 size, UNSG32 align) { - unsigned int *ptr = NULL; - unsigned int tmp = 0; + unsigned int *ptr; + unsigned int tmp; align = ALIGN(align, sizeof(int)); size += align; @@ -167,10 +167,10 @@ void *vdec_os_api_vmalloc(UNSG32 size, UNSG32 align) void vdec_os_api_dma_free(void *ptr) { - unsigned int offset = 0; - unsigned int *paddr = NULL; + unsigned int offset; + unsigned int *paddr; - paddr = (unsigned int *)(ptr); + paddr = ptr; offset = *(paddr - 1); paddr = (unsigned int *)((unsigned int)paddr - offset); bmm_free((void *)paddr); @@ -178,8 +178,8 @@ void vdec_os_api_dma_free(void *ptr) void * vdec_os_api_dma_alloc(UNSG32 size, UNSG32 align, UNSG32 * pPhysical) { - unsigned int *ptr = NULL; - unsigned int tmp = 0; + unsigned int *ptr; + unsigned int tmp; if(size <= 0) return NULL; @@ -208,8 +208,8 @@ void * vdec_os_api_dma_alloc(UNSG32 size, UNSG32 align, UNSG32 * pPhysical) void * vdec_os_api_dma_alloc_cached(UNSG32 size, UNSG32 align, UNSG32 * pPhysical) { - unsigned int *ptr = NULL; - unsigned int tmp = 0; + unsigned int *ptr; + unsigned int tmp; if(size <= 0) return NULL; @@ -238,8 +238,8 @@ void * vdec_os_api_dma_alloc_cached(UNSG32 size, UNSG32 align, UNSG32 * pPhysica void * vdec_os_api_dma_alloc_writecombine(UNSG32 size, UNSG32 align, UNSG32 * pPhysical) { - unsigned int *ptr = NULL; - unsigned int tmp = 0; + unsigned int *ptr; + unsigned int tmp; if(size <= 0) return NULL; @@ -430,7 +430,7 @@ SIGN32 vdec_os_driver_init(void) #endif // Prepare the vdec os driver control interface - vdec_iface = (vdec_os_driver_cb_t*)malloc(sizeof(vdec_os_driver_cb_t)); + vdec_iface = malloc(sizeof(vdec_os_driver_cb_t)); memset(vdec_iface, 0, sizeof(vdec_os_driver_cb_t)); if(vdec_iface == NULL) { @@ -686,10 +686,10 @@ SIGN32 vdec_os_api_get_hw_context_addr(UNSG32* paddr, UNSG32* vaddr, UNSG32 size goto get_hw_context_fail; } - *((UNSG32*) paddr) = io_mem_addr; + *paddr = io_mem_addr; vdec_iface->hw_context_pa = io_mem_addr; - dbg_printf(VDEC_DEBUG_MEM, "UIO_IO_HW_CONTEXT_ADDR: 0x%08x\n", *((UNSG32*) paddr)); + dbg_printf(VDEC_DEBUG_MEM, "UIO_IO_HW_CONTEXT_ADDR: 0x%08x\n", *paddr); get_hw_context_fail: @@ -950,7 +950,7 @@ SIGN32 vdec_os_api_register_user_id(SIGN32 user_id) return VDEC_OS_DRIVER_USER_ID_FAIL; } - p_md = (struct monitor_data*) malloc(sizeof(struct monitor_data));//This is freed monitor function + p_md = malloc(sizeof(struct monitor_data));//This is freed monitor function if(p_md == NULL) { dbg_printf(VDEC_DEBUG_ALL,"vdec_os_api_register_user_id error: OOM\n"); return VDEC_OS_DRIVER_USER_ID_FAIL; |