Fix the coding rule
[platform/core/connectivity/bluetooth-frwk.git] / bt-api / bt-adapter.c
index 42fea38..8dcc4f2 100644 (file)
@@ -50,9 +50,8 @@ static int __bt_fill_device_list(GArray *out_param2, GPtrArray **dev_list)
 
                dev_info = g_memdup(&info, sizeof(bluetooth_device_info_t));
 
-               if (dev_info) {
+               if (dev_info)
                        g_ptr_array_add(*dev_list, (gpointer)dev_info);
-               }
        }
 
        return BLUETOOTH_ERROR_NONE;
@@ -67,9 +66,8 @@ BT_EXPORT_API int bluetooth_check_adapter(void)
 
        ret = _bt_get_adapter_path(_bt_gdbus_get_system_gconn(), NULL);
 
-       if (ret != BLUETOOTH_ERROR_NONE) {
+       if (ret != BLUETOOTH_ERROR_NONE)
                return BLUETOOTH_ADAPTER_DISABLED;
-       }
 #endif
 
        /* check VCONFKEY_BT_STATUS */
@@ -194,9 +192,8 @@ BT_EXPORT_API int bluetooth_get_local_version(bluetooth_version_t *local_version
        result = _bt_send_request(BT_BLUEZ_SERVICE, BT_GET_LOCAL_VERSION,
                in_param1, in_param2, in_param3, in_param4, &out_param);
 
-       if (result == BLUETOOTH_ERROR_NONE) {
+       if (result == BLUETOOTH_ERROR_NONE)
                *local_version = g_array_index(out_param, bluetooth_version_t, 0);
-       }
 
        BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
 
@@ -265,9 +262,8 @@ BT_EXPORT_API int bluetooth_is_service_used(const char *service_uuid,
        result = _bt_send_request(BT_BLUEZ_SERVICE, BT_IS_SERVICE_USED,
                in_param1, in_param2, in_param3, in_param4, &out_param);
 
-       if (result == BLUETOOTH_ERROR_NONE) {
+       if (result == BLUETOOTH_ERROR_NONE)
                *used = g_array_index(out_param, gboolean, 0);
-       }
 
        BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
 
@@ -290,11 +286,10 @@ BT_EXPORT_API int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t
                        return BLUETOOTH_ERROR_DEVICE_NOT_ENABLED;
                }
 
-               if (timeout == -1) {
+               if (timeout == -1)
                        *discoverable_mode_ptr = BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE;
-               } else {
+               else
                        *discoverable_mode_ptr = BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE;
-               }
 
                return BLUETOOTH_ERROR_NONE;
        }
@@ -308,9 +303,8 @@ BT_EXPORT_API int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t
        result = _bt_send_request(BT_BLUEZ_SERVICE, BT_GET_DISCOVERABLE_MODE,
                in_param1, in_param2, in_param3, in_param4, &out_param);
 
-       if (result == BLUETOOTH_ERROR_NONE) {
+       if (result == BLUETOOTH_ERROR_NONE)
                *discoverable_mode_ptr = g_array_index(out_param, int, 0);
-       }
 
        BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
 
@@ -351,9 +345,8 @@ BT_EXPORT_API int bluetooth_get_timeout_value(int *timeout)
        result = _bt_send_request(BT_BLUEZ_SERVICE, BT_GET_DISCOVERABLE_TIME,
                in_param1, in_param2, in_param3, in_param4, &out_param);
 
-       if (result == BLUETOOTH_ERROR_NONE) {
+       if (result == BLUETOOTH_ERROR_NONE)
                *timeout = g_array_index(out_param, int, 0);
-       }
 
        BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
 
@@ -459,11 +452,10 @@ BT_EXPORT_API int bluetooth_is_connectable(gboolean *is_connectable)
        result = _bt_send_request(BT_BLUEZ_SERVICE, BT_IS_CONNECTABLE,
                in_param1, in_param2, in_param3, in_param4, &out_param);
 
-       if (result == BLUETOOTH_ERROR_NONE) {
+       if (result == BLUETOOTH_ERROR_NONE)
                *is_connectable = g_array_index(out_param, int, 0);
-       } else {
+       else
                BT_ERR("Fail to send request");
-       }
 
        BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
 
@@ -552,9 +544,8 @@ BT_EXPORT_API int bluetooth_get_profile_connected_device_list(
 
                                addr = g_memdup(ptr, sizeof(bluetooth_device_address_t));
 
-                               if (addr) {
+                               if (addr)
                                        g_ptr_array_add(*addr_list, (gpointer)addr);
-                               }
                        }
                }
        }