pass: Fix the checkpatch's warning to keep the coding style 69/149269/1
authorChanwoo Choi <cw00.choi@samsung.com>
Tue, 12 Sep 2017 04:09:51 +0000 (13:09 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Tue, 12 Sep 2017 04:11:11 +0000 (13:11 +0900)
This patch just fixes the following checkpatch's warnings.

[Warning results from Tizen's checkpatch]
src/pass/pass-parser.c:
:210: ERROR: [IDT_M_TAB] code indent should use tabs where possible
:210: ERROR: [IDT_M_TAB] please, no spaces at the start of a line
:480: ERROR: [SPC_M_KWD] space required before the open parenthesis '('
:483: ERROR: [SPC_M_KWD] space required before the open parenthesis '('
:615: ERROR: [SPC_M_OPR] spaces required around that '=' (ctx:WxV)

src/pass/pass.c
:355: ERROR: [IDT_M_TAB] please, no space before tabs
:366: ERROR: [IDT_M_TAB] please, no space before tabs

src/pass/pass-gov.c
:387: ERROR: [SPC_M_KWD] space required before the open parenthesis '('

src/core/device-notifier.c
:32: ERROR: [BRC_M_FTN] open brace '{' following function declarations go on the next line

src/pmqos/pmqos.c
:92: WARNING: [BRC_R_SST] braces {} are not necessary
for any arm of this statement

src/shared/log.h
:28: ERROR: [SPC_M_KWD] space required before the open parenthesis '('
:29: ERROR: [SPC_M_KWD] space required before the open parenthesis '('
:30: ERROR: [SPC_M_KWD] space required before the open parenthesis '('
:31: ERROR: [SPC_M_KWD] space required before the open parenthesis '('

src/pass/pass.h
:408: ERROR: [SPC_M_SEP] space prohibited after that open parenthesis '('
:408: ERROR: [SPC_M_SEP] space prohibited before that close parenthesis ')'
:409: ERROR: [SPC_M_OPR] space required after that ',' (ctx:VxV)
:409: ERROR: [SPC_M_OPR] space required after that ';' (ctx:VxV)
:409: ERROR: [SPC_M_SEP] space prohibited after that open parenthesis '('
:409: ERROR: [SPC_M_SEP] space prohibited before that close parenthesis ')'

src/core/config-parser.h
:40: ERROR: [IDT_M_TAB] please, no spaces at the start of a line

src/core/devices.h
:116: ERROR: [SPC_M_OPR] spaces required around that '?' (ctx:VxW)
:119: ERROR: [SPC_M_KWD] space required before the open parenthesis '('
:120: ERROR: [SPC_M_KWD] space required before the open parenthesis '('
:123: ERROR: [SPC_M_KWD] space required before the open parenthesis '('
:124: ERROR: [SPC_M_KWD] space required before the open parenthesis '('

src/core/common.h
:115: ERROR: [IDT_M_TAB] code indent should use tabs where possible
src/core/common.h:115: ERROR: [IDT_M_TAB] please, no spaces at the start of a line
src/core/common.h:116: ERROR: [IDT_M_TAB] code indent should use tabs where possible
src/core/common.h:116: ERROR: [IDT_M_TAB] please, no spaces at the start of a line
src/core/common.h:117: ERROR: [IDT_M_TAB] code indent should use tabs where possible
src/core/common.h:117: ERROR: [IDT_M_TAB] please, no spaces at the start of a line
src/core/common.h:118: ERROR: [IDT_M_TAB] code indent should use tabs where possible
src/core/common.h:118: ERROR: [IDT_M_TAB] please, no spaces at the start of a line

src/hal/hal-log.h
:29: ERROR: [SPC_M_KWD] space required before the open parenthesis '('
:30: ERROR: [SPC_M_KWD] space required before the open parenthesis '('
:31: ERROR: [SPC_M_KWD] space required before the open parenthesis '('
:32: ERROR: [SPC_M_KWD] space required before the open parenthesis '('
:33: ERROR: [SPC_M_KWD] space required before the open parenthesis '('
:34: ERROR: [SPC_M_KWD] space required before the open parenthesis '('
:35: ERROR: [SPC_M_KWD] space required before the open parenthesis '('
:36: ERROR: [SPC_M_KWD] space required before the open parenthesis '('

src/hal/hal.h
:26: ERROR: [SPC_M_OPR] space required after that ',' (ctx:VxV)
:26: ERROR: [SPC_M_OPR] space required after that ',' (ctx:VxV)
:26: ERROR: [SPC_M_OPR] space required after that ',' (ctx:VxV)
:29: ERROR: [SPC_M_OPR] space required after that ',' (ctx:VxV)
:29: ERROR: [SPC_M_OPR] space required after that ',' (ctx:VxV)
:29: ERROR: [SPC_M_OPR] space required after that ',' (ctx:VxV)
:29: ERROR: [SPC_M_OPR] space required after that ',' (ctx:VxV)
:29: ERROR: [SPC_M_OPR] space required after that ',' (ctx:Vx )
:29: ERROR: [SPC_M_OPR] space required after that ',' (ctx:VxV)
:31: ERROR: [SPC_M_OPR] space required after that ',' (ctx:VxV)
:31: ERROR: [SPC_M_OPR] space required after that ',' (ctx:VxV)
:31: ERROR: [SPC_M_OPR] space required after that ',' (ctx:VxV)

Change-Id: I9bfb0db97b825e00d89487929037f833ecc0f156
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
12 files changed:
src/core/common.h
src/core/config-parser.h
src/core/device-notifier.c
src/core/devices.h
src/hal/hal-log.h
src/hal/hal.h
src/pass/pass-gov.c
src/pass/pass-parser.c
src/pass/pass.c
src/pass/pass.h
src/pmqos/pmqos.c
src/shared/log.h

index 660111700670c4bdfe251853ac921a8331eab680..46c7490903c1454afa96fc49d99615ba7755c326 100644 (file)
@@ -112,10 +112,10 @@ static inline void safe_free_memory(void** mem)
 }
 
 #define ret_value_if(expr, val) do { \
-        if (expr) { \
-                _E("(%s)", #expr); \
-                return (val); \
-        } \
+       if (expr) { \
+               _E("(%s)", #expr); \
+               return (val); \
+       } \
 } while (0)
 
 #define ret_value_msg_if(expr, val, fmt, arg...) do {  \
index 66b72ecce9ee0e444864eb7d53b04b5795b5bb2a..32a0d9b55ec56a5f462c6b535bcfe535dfc757d6 100644 (file)
@@ -37,6 +37,6 @@ struct parse_result {
  * @return 0 on success, negative if failed
  */
 int config_parse(const char *file_name, int cb(struct parse_result *result,
-    void *user_data), void *user_data);
+                       void *user_data), void *user_data);
 
 #endif
index e88b9e7246885c26a77778d76dea0da0339aeb6e..4a03ead31cf39cc317bdc1eb42d7360d7760411d 100644 (file)
@@ -29,7 +29,8 @@ static GList *device_notifier_list;
 static guint idle_func_id = 0;
 static struct device_notifier device_notifiers[DEVICE_NOTIFIER_MAX_COUNT];
 
-static struct device_notifier *get_device_notifier(void) {
+static struct device_notifier *get_device_notifier(void)
+{
        static int pos = 0;
 
        if ((pos < DEVICE_NOTIFIER_MAX_COUNT) &&
index d7b8d9a8bdfea655ee3f984c533a38034104df88..38bad23567d7d62843b32f8c0a323fe0160ef734 100644 (file)
@@ -112,15 +112,14 @@ void remove_device(const struct device_ops *dev);
 const struct device_ops *find_device(const char *name);
 int check_default(const struct device_ops *dev);
 
-#define NOT_SUPPORT_OPS(dev) \
-       ((check_default(dev))? 1 : 0)
+#define NOT_SUPPORT_OPS(dev) ((check_default(dev)) ? 1 : 0)
 
 #define FIND_DEVICE_INT(dev, name) do { \
-       if (!dev) dev = find_device(name); if(check_default(dev)) return -ENODEV; \
-} while(0)
+       if (!dev) dev = find_device(name); if (check_default(dev)) return -ENODEV; \
+} while (0)
 
 #define FIND_DEVICE_VOID(dev, name) do { \
-       if (!dev) dev = find_device(name); if(check_default(dev)) return; \
-} while(0)
+       if (!dev) dev = find_device(name); if (check_default(dev)) return; \
+} while (0)
 
 #endif
index 3590ab56d3bd18a5dbfc06b45410f8dd33745788..7c7771edf06ddc30317ab6253d68d5d4cecdc959 100644 (file)
 #define LOG_TAG "PASS"
 #endif /* LOG_TAG */
 
-
-#define _D(fmt, arg...)                do { SLOGD(fmt, ##arg); } while(0)
-#define _I(fmt, arg...)                do { SLOGI(fmt, ##arg); } while(0)
-#define _W(fmt, arg...)                do { SLOGW(fmt, ##arg); } while(0)
-#define _E(fmt, arg...)                do { SLOGE(fmt, ##arg); } while(0)
-#define _SD(fmt, arg...)       do { SECURE_SLOGD(fmt, ##arg); } while(0)
-#define _SI(fmt, arg...)       do { SECURE_SLOGI(fmt, ##arg); } while(0)
-#define _SW(fmt, arg...)       do { SECURE_SLOGW(fmt, ##arg); } while(0)
-#define _SE(fmt, arg...)       do { SECURE_SLOGE(fmt, ##arg); } while(0)
+#define _D(fmt, arg...)                do { SLOGD(fmt, ##arg); } while (0)
+#define _I(fmt, arg...)                do { SLOGI(fmt, ##arg); } while (0)
+#define _W(fmt, arg...)                do { SLOGW(fmt, ##arg); } while (0)
+#define _E(fmt, arg...)                do { SLOGE(fmt, ##arg); } while (0)
+#define _SD(fmt, arg...)       do { SECURE_SLOGD(fmt, ##arg); } while (0)
+#define _SI(fmt, arg...)       do { SECURE_SLOGI(fmt, ##arg); } while (0)
+#define _SW(fmt, arg...)       do { SECURE_SLOGW(fmt, ##arg); } while (0)
+#define _SE(fmt, arg...)       do { SECURE_SLOGE(fmt, ##arg); } while (0)
 
 #endif /* __HAL_LOG_H__ */
index 5cae596d2c7fe542f7b81597cfb3a04ebd71639d..b9e2699a2615d512fcd8ff8895b4914473f065c1 100644 (file)
 
 #define BUFF_MAX       255
 
-#define MAKE_4B_CODE_4(A,B,C,D) \
-       ((((A) & 0xff) << 24) | (((B) & 0xff) << 16) | \
+#define MAKE_4B_CODE_4(A, B, C, D)                             \
+       ((((A) & 0xff) << 24) | (((B) & 0xff) << 16) |          \
         (((C) & 0xff) << 8) | (((D) & 0xff)))
-#define MAKE_TAG_CONSTANT(A,B,C,D)     MAKE_4B_CODE_4(A,B,C,D)
+#define MAKE_TAG_CONSTANT(A, B, C, D)  MAKE_4B_CODE_4(A, B, C, D)
 
-#define HAL_INFO_TAG       MAKE_TAG_CONSTANT('P','A','S','S')
+#define HAL_INFO_TAG       MAKE_TAG_CONSTANT('P', 'A', 'S', 'S')
 
 /* Symbolic name of the HAL info (PASS HAL Info) */
 #define HAL_INFO_SYM   PassHalInfo
index 7bb1e3cfa512d255024d9bca10912d813018e679..c51d1a9ed77a2c18d20d56e99b4fab4935596c70 100644 (file)
@@ -384,7 +384,7 @@ static int __pass_governor_init(struct pass_policy *policy)
 {
        int ret;
 
-       if(policy->gov_timeout < 0) {
+       if (policy->gov_timeout < 0) {
                _E("invalid timeout value [%d]!", policy->gov_timeout);
                pass_governor_update(policy, PASS_GOV_STOP);
                return -EINVAL;
index 6e8a0722948d6242e04abfb4087b12e379a13251..1add5fb700f2d531594863d97401af10c1cdb4b1 100644 (file)
@@ -207,7 +207,7 @@ static int pass_parse_core(struct parse_result *result, void *user_data)
        if (!result->section || !result->name || !result->value)
                return 0;
 
-        if (MATCH(result->name, "pass_support"))
+       if (MATCH(result->name, "pass_support"))
                policy->state = atoi(result->value);
        else if (MATCH(result->name, "pass_gov_type"))
                policy->gov_type = atoi(result->value);
@@ -477,10 +477,10 @@ int pass_get_table(struct pass_policy *policy, char *pass_conf_path)
 
 void pass_put_table(struct pass_policy *policy)
 {
-       if(policy->pass_table)
+       if (policy->pass_table)
                free(policy->pass_table);
 
-       if(policy->scenario.list)
+       if (policy->scenario.list)
                free(policy->scenario.list);
 }
 
@@ -612,7 +612,7 @@ static int pass_resource_config(struct parse_result *result, void *user_data)
                        len = strlen(result->value);
                        snprintf(path_compatible, len + 1, "%s", result->value);
 
-                       len =strlen(compatible);
+                       len = strlen(compatible);
                        if (len > 0) {
                                ret = check_compatible(compatible, path_compatible);
                                if (ret < 0)
index 4e4646543fbb5d538eebe8546a7de12fcfe8a66b..894abe5bc53960fe52406df3d64df7b957591d4e 100644 (file)
@@ -352,7 +352,7 @@ static int pass_exit_done(void)
  * pass_init - Initialize PASS(Power Aware System Service)
  *
  * @data: When the data is passed from pass_main(), it is NULL.
- *       On the other hand, it will contain the result of this function
+ *     On the other hand, it will contain the result of this function
  */
 static void pass_init(void *data)
 {
@@ -363,7 +363,7 @@ static void pass_init(void *data)
  * pass_exit - Exit PASS
  *
  * @data: When the data is passed from pass_main(), it is NULL.
- *       On the other hand, it will contain the result of this function
+ *     On the other hand, it will contain the result of this function
  */
 static void pass_exit(void *data)
 {
index 060e94b9f1124cc8fcc7256303ebb7cd6e6c4ce1..1a81c18edac3339e6a595e5c3b4dcf21a77aa195 100644 (file)
@@ -405,8 +405,8 @@ struct pass {
 };
 
 #define container_of(ptr, type, member) ({                     \
-       const typeof( ((type *)0)->member ) *__mptr = (ptr);    \
-       (type *)( (char *)__mptr - offsetof(type,member) );})
+       const typeof(((type *)0)->member) *__mptr = (ptr);      \
+       (type *)((char *)__mptr - offsetof(type, member)); })
 
 #define to_pass_resource(policy)       \
        container_of(policy, struct pass_resource, policy)
index 5543e6dbde6a4e9656d96f995241aa372f0799b9..bf6120f860139b586ced4b212a8b79973b1d976d 100644 (file)
@@ -89,11 +89,10 @@ static gboolean dbus_cb_pmqos_start(SystemPassPmqos *obj,
        int ret = 0;
        int booting_done = 1;
 
-       if (g_initialized) {
+       if (g_initialized)
                _I("PASS PMQoS is already started\n");
-       } else {
+       else
                ret = pmqos_init_done(&booting_done, NULL);
-       }
 
        g_dbus_method_invocation_return_value(invoc, g_variant_new("(i)", ret));
 
index 105332d7a898d0dc0198ea4332add59cbe190b82..d170161de83a93c70629dd19cafd6c4a0618f9f8 100644 (file)
@@ -25,8 +25,8 @@
 #define LOG_TAG "PASS"
 #endif /* LOG_TAG */
 
-#define _D(fmt, arg...)                do { SLOGD(fmt, ##arg); } while(0)
-#define _I(fmt, arg...)                do { SLOGI(fmt, ##arg); } while(0)
-#define _W(fmt, arg...)                do { SLOGW(fmt, ##arg); } while(0)
-#define _E(fmt, arg...)                do { SLOGE(fmt, ##arg); } while(0)
+#define _D(fmt, arg...)                do { SLOGD(fmt, ##arg); } while (0)
+#define _I(fmt, arg...)                do { SLOGI(fmt, ##arg); } while (0)
+#define _W(fmt, arg...)                do { SLOGW(fmt, ##arg); } while (0)
+#define _E(fmt, arg...)                do { SLOGE(fmt, ##arg); } while (0)
 #endif