From 8d7ce608cd21be42499fab38c780c4923a17ca25 Mon Sep 17 00:00:00 2001 From: Russell King Date: Thu, 18 Oct 2012 00:30:29 +0100 Subject: Formatting cleanups and make unexported functions static --- vmeta_lib.c | 77 +++++++++++++++++++++++++++++++------------------------------ vmeta_lib.h | 2 +- 2 files changed, 40 insertions(+), 39 deletions(-) diff --git a/vmeta_lib.c b/vmeta_lib.c index de0fb53..dd588d2 100755 --- a/vmeta_lib.c +++ b/vmeta_lib.c @@ -48,10 +48,10 @@ static SIGN32 vmeta_private_unlock(); static SIGN32 vdec_os_api_get_ks(kernel_share **pp_ks);//get kernel shared resources // global variable -vdec_os_driver_cb_t *vdec_iface = NULL; -UNSG32 globalDbgLevel = VDEC_DEBUG_NONE; -UNSG32 syncTimeout = 500; -pthread_mutex_t pmt = PTHREAD_MUTEX_INITIALIZER; +static vdec_os_driver_cb_t *vdec_iface = NULL; +static UNSG32 globalDbgLevel = VDEC_DEBUG_NONE; +static UNSG32 syncTimeout = 500; +static pthread_mutex_t pmt = PTHREAD_MUTEX_INITIALIZER; static inline int get_bit(int nr, unsigned int *addr) { @@ -333,7 +333,7 @@ SIGN32 vdec_os_api_sync_event() //End of mem mmap #define VMETA_VERSION_PREFIX "build-" -int get_version(char *msg) +static int get_version(char *msg) { int ret; int version; @@ -355,7 +355,7 @@ int get_version(char *msg) return version; } -UNSG32 get_mem_size(char *msg) +static UNSG32 get_mem_size(char *msg) { int ret; UNSG32 result; @@ -376,7 +376,7 @@ UNSG32 get_mem_size(char *msg) return result; } -UNSG32 get_mem_addr(char *msg) +static UNSG32 get_mem_addr(char *msg) { UNSG32 result; int ret; @@ -558,7 +558,7 @@ SIGN32 vdec_os_driver_clean(void) } /* display debug message */ -int dbg_printf(UNSG32 dbglevel, const char* format, ...) { +static int dbg_printf(UNSG32 dbglevel, const char* format, ...) { char dbgBuf[256] = {'\0'}; va_list var; #if VMETA_LOG_ON @@ -590,7 +590,7 @@ DBG_PRINT: #if VMETA_LOG_ON fprintf(fp_log,dbgBuf); #else - printf(dbgBuf); + printf("%s", dbgBuf); #endif DBG_EXIT: @@ -601,7 +601,8 @@ DBG_EXIT: } /* vdec driver get cb */ -vdec_os_driver_cb_t *vdec_driver_get_cb(void) { +vdec_os_driver_cb_t *vdec_driver_get_cb(void) +{ return vdec_iface; } @@ -730,7 +731,7 @@ get_vos_fail: return ret; } -int find_user_id(id_instance *list)//return unoccupied id +static int find_user_id(id_instance *list)//return unoccupied id { int i; for(i=0; iref_count--; return VDEC_OS_DRIVER_OK; - } +} - SIGN32 vmeta_private_lock() - { +static SIGN32 vmeta_private_lock() +{ ioctl(vdec_iface->uiofd,VMETA_CMD_PRIV_LOCK,(unsigned long)0xffffffff); return 0; - } +} - SIGN32 vmeta_private_unlock() - { +static SIGN32 vmeta_private_unlock() +{ ioctl(vdec_iface->uiofd,VMETA_CMD_PRIV_UNLOCK); return 0; - } +} - SIGN32 vdec_os_api_get_user_count(void) - { +SIGN32 vdec_os_api_get_user_count(void) +{ vdec_os_driver_cb_t *p_cb = vdec_driver_get_cb(); kernel_share *p_ks; @@ -1030,10 +1031,10 @@ tag_monitor_fail: dbg_printf(VDEC_DEBUG_ALL, "get_user_count=%d \n",p_ks->ref_count); return p_ks->ref_count; - } +} - SIGN32 vdec_os_api_lock(SIGN32 user_id, long to_ms) - { +SIGN32 vdec_os_api_lock(SIGN32 user_id, long to_ms) +{ vdec_os_driver_cb_t *p_cb = vdec_driver_get_cb(); kernel_share* p_ks; struct timespec ts; @@ -1069,10 +1070,10 @@ tag_monitor_fail: vmeta_private_unlock(); return LOCK_RET_OHTERS_NORM; - } +} - SIGN32 vdec_os_api_unlock(SIGN32 user_id) - { +SIGN32 vdec_os_api_unlock(SIGN32 user_id) +{ vdec_os_driver_cb_t *p_cb = vdec_driver_get_cb(); kernel_share* p_ks; int ret; @@ -1104,7 +1105,7 @@ tag_monitor_fail: } return LOCK_RET_OHTERS_NORM; - } +} SIGN32 vdec_os_api_power_on(void) { diff --git a/vmeta_lib.h b/vmeta_lib.h index cfad352..c2367e1 100755 --- a/vmeta_lib.h +++ b/vmeta_lib.h @@ -173,7 +173,7 @@ typedef enum _LOCK_RET_CODE { /* display debug message */ #define VMETA_LOG_ON 0 #define VMETA_LOG_FILE "/data/vmeta_dbg.log" -int dbg_printf(UNSG32 dbglevel, const char* format, ...); +static int dbg_printf(UNSG32 dbglevel, const char* format, ...); typedef sem_t lock_t; //--------------------------------------------------------------------------- -- cgit