fix violations of coding rule
authorsunghan <sh924.chang@samsung.com>
Thu, 17 Aug 2017 07:01:44 +0000 (16:01 +0900)
committersunghan <sh924.chang@samsung.com>
Thu, 17 Aug 2017 07:01:44 +0000 (16:01 +0900)
on apps/examples/testcase, framework, lib, os/drivers, os/fs and os/kernel

apps/examples/testcase/le_tc/kernel/tc_semaphore.c
apps/examples/testcase/le_tc/kernel/tc_umm_heap.c
framework/src/arastorage/index_bplustree.c
lib/libc/math/libm.h
os/drivers/bch/bch.h
os/drivers/rtc.c
os/drivers/wireless/scsc/misc/utils_misc.h
os/drivers/wireless/scsc/wlan_80211_utils.h
os/drivers/wireless/scsc/wpa_driver_copy.h
os/fs/driver/block/driver.h
os/kernel/pthread/pthread.h

index 05a5cfb..999b389 100644 (file)
@@ -153,7 +153,7 @@ static void tc_semaphore_sem_post_wait(void)
        TC_ASSERT_EQ_CLEANUP("pthread_join", pexit_value, NULL, goto cleanup);
 
        ret_chk = pthread_join(cid, &pexit_value);
-       TC_ASSERT_EQ_CLEANUP("pthread_join", ret_chk, OK,goto cleanup);
+       TC_ASSERT_EQ_CLEANUP("pthread_join", ret_chk, OK, goto cleanup);
        TC_ASSERT_EQ_CLEANUP("pthread_join", pexit_value, NULL, goto cleanup);
 
        TC_SUCCESS_RESULT();
index f201a32..8958168 100644 (file)
@@ -35,7 +35,7 @@
 #define ALLOC_FREE_TIMES 5
 #define TEST_TIMES 100
 #define ALL_FREE 0
-#define TOTAL_ALLOC_SIZE (MM_ALIGN_UP((sizeof(int)*ALLOC_SIZE_VAL) + SIZEOF_MM_ALLOCNODE))*ALLOC_FREE_TIMES
+#define TOTAL_ALLOC_SIZE (MM_ALIGN_UP((sizeof(int) * ALLOC_SIZE_VAL) + SIZEOF_MM_ALLOCNODE)) * ALLOC_FREE_TIMES
 /****************************************************************************
  * Definitions
  ****************************************************************************/
index 5753c30..17eae84 100644 (file)
@@ -550,7 +550,7 @@ static db_result_t load(index_t *index)
        DB_LOG_D("load index : descriptor file name : %s\n", index->descriptor_file);
        fd = storage_open(index->descriptor_file, O_RDWR);
        if (fd < 0) {
-               DB_LOG_E("Failed opening index descriptor file :%s Error Code %d",index->descriptor_file);
+               DB_LOG_E("Failed opening index descriptor file :%s Error Code %d", index->descriptor_file);
                free(tree);
                return DB_STORAGE_ERROR;
        }
index cec1ec1..8a0bdf4 100644 (file)
@@ -91,99 +91,111 @@ union ldshape {
  *     Pre-processor Definitions
  ***************************************************************************/
 
-#define FORCE_EVAL(x)                                                          \
-       do {                                                                                    \
-               if (sizeof(x) == sizeof(float)) {               \
-                       volatile float __x;                             \
-                       __x = (x);                                      \
-               } else if (sizeof(x) == sizeof(double)) {       \
-                       volatile double __x;                            \
-                       __x = (x);                                      \
-               } else {                                        \
-                       volatile long double __x;                       \
-                       __x = (x);                                      \
-       }                                                       \
-} while(0)
+#define FORCE_EVAL(x)                               \
+       do {                                            \
+               if (sizeof(x) == sizeof(float)) {           \
+                       volatile float __x;                     \
+                       __x = (x);                              \
+               } else if (sizeof(x) == sizeof(double)) {   \
+                       volatile double __x;                    \
+                       __x = (x);                              \
+               } else {                                    \
+                       volatile long double __x;               \
+                       __x = (x);                              \
+       }                                               \
+} while (0)
 
 /* Get two 32 bit ints from a double.  */
-#define EXTRACT_WORDS(hi,lo,d)         \
+#define EXTRACT_WORDS(hi, lo, d)    \
        do {                            \
-               union {                                         \
-                       double f;                               \
-                       uint64_t i;                             \
-               } __u;                          \
-               __u.f = (d);                    \
+               union {                     \
+                       double f;               \
+                       uint64_t i;             \
+               } __u;                      \
+               __u.f = (d);                \
                (hi) = __u.i >> 32;         \
                (lo) = (uint32_t)__u.i;     \
        } while (0)
 
 /* Get the more significant 32 bit int from a double.  */
-#define GET_HIGH_WORD(hi,d)                    \
-       do {                                                    \
-               union {                                         \
-                       double f;                               \
-                       uint64_t i;                             \
-               } __u;                                          \
-               __u.f = (d);                    \
+#define GET_HIGH_WORD(hi, d)        \
+       do {                            \
+               union {                     \
+                       double f;               \
+                       uint64_t i;             \
+               } __u;                      \
+               __u.f = (d);                \
                (hi) = __u.i >> 32;         \
        } while (0)
 
 /* Get the less significant 32 bit int from a double.  */
-#define GET_LOW_WORD(lo,d)                     \
-       do {                            \
-               union {                                         \
-                       double f;                               \
-                       uint64_t i;                             \
-               } __u;                          \
-               __u.f = (d);                    \
-               (lo) = (uint32_t)__u.i;         \
+#define GET_LOW_WORD(lo, d)         \
+       do {                            \
+               union {                     \
+                       double f;               \
+                       uint64_t i;             \
+               } __u;                      \
+               __u.f = (d);                \
+               (lo) = (uint32_t)__u.i;     \
        } while (0)
 
 /* Set a double from two 32 bit ints.  */
-#define INSERT_WORDS(d,hi,lo)                                  \
-       do {                                                    \
-               union {                                                                                 \
-                       double f;                                                                       \
-                       uint64_t i;                                                                     \
-               } __u;                                                                                  \
-               __u.i = ((uint64_t)(hi)<<32) | (uint32_t)(lo);  \
-               (d) = __u.f;                                    \
+#define INSERT_WORDS(d, hi, lo)                         \
+       do {                                                \
+               union {                                         \
+                       double f;                                   \
+                       uint64_t i;                                 \
+               } __u;                                          \
+               __u.i = ((uint64_t)(hi) << 32) | (uint32_t)(lo);\
+               (d) = __u.f;                                    \
        } while (0)
 
 /* Set the more significant 32 bits of a double from an int.  */
-#define SET_HIGH_WORD(d,hi)                                            \
-       do {                                            \
-               union {double f; uint64_t i;} __u;      \
-               __u.f = (d);                            \
-               __u.i &= 0xffffffff;                    \
-               __u.i |= (uint64_t)(hi) << 32;          \
-               (d) = __u.f;                            \
+#define SET_HIGH_WORD(d, hi)                    \
+       do {                                        \
+               union {                                 \
+                       double f;                           \
+                       uint64_t i;                         \
+               } __u;                                  \
+               __u.f = (d);                            \
+               __u.i &= 0xffffffff;                    \
+               __u.i |= (uint64_t)(hi) << 32;          \
+               (d) = __u.f;                            \
        } while (0)
 
 /* Set the less significant 32 bits of a double from an int.  */
-#define SET_LOW_WORD(d,lo)                                             \
-       do {                                            \
-               union {double f; uint64_t i;} __u;      \
-               __u.f = (d);                            \
-               __u.i &= 0xffffffff00000000ull;         \
-               __u.i |= (uint32_t)(lo);                \
+#define SET_LOW_WORD(d, lo)                     \
+       do {                                        \
+               union {                                 \
+                       double f;                           \
+                       uint64_t i;                         \
+               } __u;                                  \
+               __u.f = (d);                            \
+               __u.i &= 0xffffffff00000000ull;         \
+               __u.i |= (uint32_t)(lo);                \
                (d) = __u.f;                            \
        } while (0)
 
 /* Get a 32 bit int from a float.  */
-#define GET_FLOAT_WORD(w,d)                                            \
-       do {                                            \
-               union {float f; uint32_t i;} __u;       \
-               __u.f = (d);                            \
-               (w) = __u.i;                            \
+#define GET_FLOAT_WORD(w, d)                    \
+       do {                                        \
+               union {                                 \
+                       float f;                            \
+                       uint32_t i;                         \
+               } __u;                                  \
+               __u.f = (d);                            \
+               (w) = __u.i;                            \
        } while (0)
 
 /* Set a float from a 32 bit int.  */
-#define SET_FLOAT_WORD(d,w)                                            \
-       do {                                            \
-               union {float f; uint32_t i;} __u;       \
-               __u.i = (w);                            \
-               (d) = __u.f;                            \
+#define SET_FLOAT_WORD(d, w)                    \
+       do {                                        \
+               union {                                 \
+                       float f;                            \
+                       uint32_t i;                         \
+               } __u;                                  \
+               __u.i = (w);                            \
+               (d) = __u.f;                            \
        } while (0)
 
 #undef __CMPLX
@@ -191,13 +203,13 @@ union ldshape {
 #undef CMPLXF
 #undef CMPLXL
 
-#define __CMPLX(x, y, t)               \
-       ((union {                                       \
-               _Complex t __z;                 \
-               t __xy[2];                              \
-       }){.__xy = {(x),(y)}}.__z)
+#define __CMPLX(x, y, t)        \
+       ((union {                   \
+               _Complex t __z;         \
+               t __xy[2];              \
+       }){.__xy = {(x), (y)}}.__z)
 
-#define CMPLX(x, y) __CMPLX(x, y, double)
+#define CMPLX(x, y)  __CMPLX(x, y, double)
 #define CMPLXF(x, y) __CMPLX(x, y, float)
 #define CMPLXL(x, y) __CMPLX(x, y, long double)
 
index 78af6f7..33a6994 100644 (file)
@@ -72,8 +72,7 @@
 /****************************************************************************
  * Public Types
  ****************************************************************************/
-struct bchlib_s
-{
+struct bchlib_s {
        FAR struct inode *inode;        /* I-node of the block driver */
        uint32_t sectsize;                      /* The size of one sector on the device */
        size_t nsectors;                        /* Number of sectors supported by the device */
index 1e5b825..2eee813 100644 (file)
@@ -276,8 +276,7 @@ static int rtc_close(FAR struct file *filep)
         * unlinked, then commit Hara-Kiri now.
         */
 
-       if (upper->crefs == 0 && upper->unlinked)
-       {
+       if (upper->crefs == 0 && upper->unlinked) {
                rtc_destroy(upper);
        }
 
index 849d70e..7b9ef95 100644 (file)
@@ -221,17 +221,17 @@ static inline unsigned long get_first_bit(unsigned long elem)
        return num;
 }
 
-#define min(x,y) ({ \
-        typeof(x) _x = (x);     \
-        typeof(y) _y = (y);     \
-        (void) (&_x == &_y);    \
-        _x < _y ? _x : _y; })
-
-#define max(x,y) ({ \
-        typeof(x) _x = (x);     \
-        typeof(y) _y = (y);     \
-        (void) (&_x == &_y);    \
-        _x > _y ? _x : _y; })
+#define min(x, y) ({ \
+               typeof(x) _x = (x);     \
+               typeof(y) _y = (y);     \
+               (void) (&_x == &_y);    \
+               _x < _y ? _x : _y; })
+
+#define max(x, y) ({ \
+               typeof(x) _x = (x);     \
+               typeof(y) _y = (y);     \
+               (void) (&_x == &_y);    \
+               _x > _y ? _x : _y; })
 
 static unsigned long find_first_bit(const unsigned long *addr, unsigned long size)
 {
@@ -391,7 +391,7 @@ static inline void prefetch(__attribute__((unused))
 
 #define container_of(ptr, type, member) ({                             \
                const typeof(((type*)0)->member) *__mptr = (ptr);       \
-               (type *)((char *)__mptr - offsetof(type, member));})
+               (type *)((char *)__mptr - offsetof(type, member)); })
 
 /**
  * dlist_entry - get the struct for this entry
index 77fec65..77bc59b 100644 (file)
 
 #define SLSI_REG_RULE(start, end, bw, gain, eirp, reg_flags)    \
 {                                   \
-    .start_freq_khz = SLSI_MHZ_TO_KHZ(start),           \
-    .end_freq_khz = SLSI_MHZ_TO_KHZ(end),           \
-    .max_bandwidth_khz = SLSI_MHZ_TO_KHZ(bw),           \
-    .max_antenna_gain = SLSI_DBI_TO_MBI(gain),      \
-    .max_eirp = SLSI_DBM_TO_MBM(eirp),          \
-    .flags = reg_flags,                     \
+       .start_freq_khz = SLSI_MHZ_TO_KHZ(start),           \
+       .end_freq_khz = SLSI_MHZ_TO_KHZ(end),           \
+       .max_bandwidth_khz = SLSI_MHZ_TO_KHZ(bw),           \
+       .max_antenna_gain = SLSI_DBI_TO_MBI(gain),      \
+       .max_eirp = SLSI_DBM_TO_MBM(eirp),          \
+       .flags = reg_flags,                     \
 }
 
 enum slsi_80211_eid {
index 9eb3729..a6311fd 100644 (file)
@@ -347,10 +347,10 @@ struct wpa_driver_capa {
 #define WPA_DRIVER_SMPS_MODE_DYNAMIC                   0x00000002
        unsigned int smps_modes;
 
-       unsigned int wmm_ac_supported: 1;
+       unsigned int wmm_ac_supported:1;
 
-       unsigned int mac_addr_rand_scan_supported: 1;
-       unsigned int mac_addr_rand_sched_scan_supported: 1;
+       unsigned int mac_addr_rand_scan_supported:1;
+       unsigned int mac_addr_rand_sched_scan_supported:1;
 
        /** Maximum number of supported active probe SSIDs */
        int max_scan_ssids;
@@ -513,7 +513,7 @@ struct wpa_driver_scan_params {
         * Mbps from the support rates element(s) in the Probe Request frames
         * and not to transmit the frames at any of those rates.
         */
-       unsigned int p2p_probe: 1;
+       unsigned int p2p_probe:1;
 
        /**
         * only_new_results - Request driver to report only new results
@@ -522,7 +522,7 @@ struct wpa_driver_scan_params {
         * been detected after this scan request has been started, i.e., to
         * flush old cached BSS entries.
         */
-       unsigned int only_new_results: 1;
+       unsigned int only_new_results:1;
 
        /**
         * low_priority - Requests driver to use a lower scan priority
@@ -530,12 +530,12 @@ struct wpa_driver_scan_params {
         * This is used to request the driver to use a lower scan priority
         * if it supports such a thing.
         */
-       unsigned int low_priority: 1;
+       unsigned int low_priority:1;
 
        /**
         * mac_addr_rand - Requests driver to randomize MAC address
         */
-       unsigned int mac_addr_rand: 1;
+       unsigned int mac_addr_rand:1;
 
        /**
         * mac_addr - MAC address used with randomization. The address cannot be
index a39d61f..9aa1d6f 100644 (file)
@@ -137,7 +137,7 @@ int find_blockdriver(FAR const char *pathname, int mountflags, FAR struct inode
  *
  ****************************************************************************/
 #if !defined(CONFIG_DISABLE_PSEUDOFS_OPERATIONS) && \
-    !defined(CONFIG_DISABLE_MOUNTPOINT)
+       !defined(CONFIG_DISABLE_MOUNTPOINT)
 int block_proxy(FAR const char *blkdev, int oflags);
 #endif
 
index 38fadba..9ce3b04 100644 (file)
@@ -133,7 +133,7 @@ int pthread_mutex_trytake(FAR struct pthread_mutex_s *mutex);
 int pthread_mutex_give(FAR struct pthread_mutex_s *mutex);
 void pthread_mutex_inconsistent(FAR struct pthread_tcb_s *tcb);
 #else
-#define pthread_mutex_take(m,i) pthread_sem_take(&(m)->sem,(i))
+#define pthread_mutex_take(m, i) pthread_sem_take(&(m)->sem, (i))
 #define pthread_mutex_trytake(m) pthread_sem_trytake(&(m)->sem)
 #define pthread_mutex_give(m)   pthread_sem_give(&(m)->sem)
 #endif