From: Junkyeong Kim Date: Wed, 1 Jun 2016 07:14:55 +0000 (+0900) Subject: erase tdm log macros semicolon X-Git-Tag: accepted/tizen/common/20160606.141629^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ad3d294b782be0e2b55887399e81084253886bf3;p=platform%2Fcore%2Fuifw%2Flibtdm.git erase tdm log macros semicolon Change-Id: Ic012277818e726da3bc9f3e92758e59a038d7c7c Signed-off-by: Junkyeong Kim --- diff --git a/include/tdm_log.h b/include/tdm_log.h index 02943c0..c55acf6 100644 --- a/include/tdm_log.h +++ b/include/tdm_log.h @@ -79,14 +79,15 @@ extern int tdm_debug; #define LOG_TAG "TDM" #define TDM_DBG(fmt, args...) \ - if (tdm_debug) \ do { \ - struct timespec ts; \ - clock_gettime(CLOCK_MONOTONIC, &ts); \ - LOGD("[%d.%06d] "fmt"\n", (int)ts.tv_sec, (int)ts.tv_nsec / 1000, ##args); \ - printf("[TDM_DBG][%d.%06d][%d][%s %d] "fmt"\n", (int)ts.tv_sec, \ - (int)ts.tv_nsec / 1000, (int)syscall(SYS_gettid), __func__, __LINE__, ##args); \ - } while (0); + if (tdm_debug) { \ + struct timespec ts; \ + clock_gettime(CLOCK_MONOTONIC, &ts); \ + LOGD("[%d.%06d] "fmt"\n", (int)ts.tv_sec, (int)ts.tv_nsec / 1000, ##args); \ + printf("[TDM_DBG][%d.%06d][%d][%s %d] "fmt"\n", (int)ts.tv_sec, \ + (int)ts.tv_nsec / 1000, (int)syscall(SYS_gettid), __func__, __LINE__, ##args); \ + } \ + } while (0) #define TDM_INFO(fmt, args...) \ do { \ @@ -95,7 +96,7 @@ extern int tdm_debug; LOGI("[%d.%06d] "fmt"\n", (int)ts.tv_sec, (int)ts.tv_nsec / 1000, ##args); \ printf("[TDM_INF][%d.%06d][%d][%s %d] "fmt"\n", (int)ts.tv_sec, \ (int)ts.tv_nsec / 1000, (int)syscall(SYS_gettid), __func__, __LINE__, ##args); \ - } while (0); + } while (0) #define TDM_WRN(fmt, args...) \ do { \ @@ -104,7 +105,7 @@ extern int tdm_debug; LOGI("[%d.%06d] "fmt"\n", (int)ts.tv_sec, (int)ts.tv_nsec / 1000, ##args); \ printf("[TDM_WRN][%d.%06d][%d][%s %d] "fmt"\n", (int)ts.tv_sec, \ (int)ts.tv_nsec / 1000, (int)syscall(SYS_gettid), __func__, __LINE__, ##args); \ - } while (0); + } while (0) #define TDM_ERR(fmt, args...) \ do { \ @@ -113,7 +114,7 @@ extern int tdm_debug; LOGE("[%d.%06d] "fmt"\n", (int)ts.tv_sec, (int)ts.tv_nsec / 1000, ##args); \ printf("[TDM_ERR][%d.%06d][%d][%s %d] "fmt"\n", (int)ts.tv_sec, \ (int)ts.tv_nsec / 1000, (int)syscall(SYS_gettid), __func__, __LINE__, ##args); \ - } while (0); + } while (0) #else /* TDM_CONFIG_DLOG */ @@ -125,13 +126,14 @@ extern int tdm_debug; #define COLOR_RESET "\x1b[0m" #define TDM_DBG(fmt, args...) \ - if (tdm_debug) \ do { \ - struct timespec ts; \ - clock_gettime(CLOCK_MONOTONIC, &ts); \ - printf("[TDM_DBG][%d.%06d][%d][%s %d] "fmt"\n", (int)ts.tv_sec, \ - (int)ts.tv_nsec / 1000, (int)syscall(SYS_gettid), __func__, __LINE__, ##args); \ - } while (0); + if (tdm_debug) { \ + struct timespec ts; \ + clock_gettime(CLOCK_MONOTONIC, &ts); \ + printf("[TDM_DBG][%d.%06d][%d][%s %d] "fmt"\n", (int)ts.tv_sec, \ + (int)ts.tv_nsec / 1000, (int)syscall(SYS_gettid), __func__, __LINE__, ##args); \ + } \ + } while (0) #define TDM_INFO(fmt, args...) \ do { \ @@ -139,7 +141,7 @@ extern int tdm_debug; clock_gettime(CLOCK_MONOTONIC, &ts); \ printf(COLOR_GREEN"[TDM_INF]"COLOR_RESET"[%d.%06d][%d][%s %d] "fmt"\n", (int)ts.tv_sec, \ (int)ts.tv_nsec / 1000, (int)syscall(SYS_gettid), __func__, __LINE__, ##args); \ - } while (0); + } while (0) #define TDM_WRN(fmt, args...) \ do { \ @@ -148,7 +150,7 @@ extern int tdm_debug; printf(COLOR_YELLOW"[TDM_WRN]"COLOR_RESET"[%d.%06d][%d][%s %d] "fmt"\n", (int)ts.tv_sec, \ (int)ts.tv_nsec / 1000, (int)syscall(SYS_gettid), __func__, __LINE__, ##args); \ TDM_ASSERT(0); \ - } while (0); + } while (0) #define TDM_ERR(fmt, args...) \ do { \ @@ -157,7 +159,7 @@ extern int tdm_debug; printf(COLOR_RED"[TDM_ERR]"COLOR_RESET"[%d.%06d][%d][%s %d] "fmt"\n", (int)ts.tv_sec, \ (int)ts.tv_nsec / 1000, (int)syscall(SYS_gettid), __func__, __LINE__, ##args); \ TDM_ASSERT(0); \ - } while (0); + } while (0) #endif /* TDM_CONFIG_DLOG */ diff --git a/src/tdm_display.c b/src/tdm_display.c index 969b227..2fdc486 100644 --- a/src/tdm_display.c +++ b/src/tdm_display.c @@ -154,11 +154,10 @@ _tdm_display_lock(tdm_display *dpy, const char *func) ret = pthread_mutex_trylock(&private_display->lock); if (ret < 0) { - if (ret == EBUSY) { + if (ret == EBUSY) TDM_ERR("mutex lock busy: %s", func); - } else { + else TDM_ERR("mutex lock failed: %s(%m)", func); - } return TDM_ERROR_OPERATION_FAILED; } @@ -1578,7 +1577,7 @@ tdm_layer_get_displaying_buffer(tdm_layer *layer, tdm_error *error) if (error) *error = TDM_ERROR_OPERATION_FAILED; _pthread_mutex_unlock(&private_display->lock); - TDM_ERR("layer(%p) showing_buffer is null", private_layer); + TDM_DBG("layer(%p) showing_buffer is null", private_layer); return NULL; } _pthread_mutex_unlock(&private_display->lock);