Removed redundant g_pd checks in dbus wpasupplicant plugin 34/57034/2
authorNishant Chaprana <n.chaprana@samsung.com>
Thu, 14 Jan 2016 13:55:13 +0000 (19:25 +0530)
committerNishant Chaprana <n.chaprana@samsung.com>
Mon, 18 Jan 2016 08:34:29 +0000 (14:04 +0530)
1. Removed redundant g_pd checks in dbus wpasupplicant plugin
2. Also corrected some formatiing errors.

Change-Id: If5d9597b9c40cef4c8bb13a22231ef91cb7e98c3
Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
packaging/wifi-direct-manager.spec
plugin/wpasupplicant/ctrl_iface_dbus/wfd-plugin-wpasupplicant.c

index 521efdd..ed2e925 100755 (executable)
@@ -1,6 +1,6 @@
 Name:          wifi-direct-manager
 Summary:       Wi-Fi Direct manger
-Version:       1.2.115
+Version:       1.2.116
 Release:       1
 Group:      Network & Connectivity/Wireless
 License:    Apache-2.0
index 638a714..badf810 100755 (executable)
@@ -438,10 +438,10 @@ static void _supplicant_signal_cb(GDBusConnection *connection,
        DEBUG_SIGNAL(sender, object_path, interface, signal, parameters);
 #endif /* TIZEN_DEBUG_DBUS_VALUE */
 
-    if(!g_pd) {
-        WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
-        return;
-        }
+       if (!g_pd) {
+               WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+               return;
+       }
 
        if (!g_strcmp0(signal,"InterfaceAdded")) {
                WDP_LOGD("InterfaceAdded");
@@ -791,10 +791,10 @@ void __ws_extract_group_details(const char *key, GVariant *value, void *user_dat
        if(!event || !event->edata)
                return;
 
-    if(!g_pd) {
-        WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
-        return;
-        }
+       if (!g_pd) {
+               WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+               return;
+       }
 
        wfd_oem_group_data_s *group = (wfd_oem_group_data_s *)event->edata;
 #if defined (TIZEN_DEBUG_DBUS_VALUE)
@@ -1044,10 +1044,10 @@ static int _ws_flush()
        dbus_method_param_s params;
        int res = 0;
 
-    if(!g_pd) {
-        WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
-        return -1;
-        }
+       if (!g_pd) {
+               WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+               return -1;
+       }
 
        g_dbus = g_pd->g_dbus;
        if (!g_dbus) {
@@ -1076,10 +1076,10 @@ static int _ws_cancel()
        dbus_method_param_s params;
        int res = 0;
 
-    if(!g_pd) {
-        WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
-        return -1;
-        }
+       if (!g_pd) {
+               WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+               return -1;
+       }
 
 
        g_dbus = g_pd->g_dbus;
@@ -1110,11 +1110,6 @@ static void _ws_process_device_found(GDBusConnection *connection,
        wfd_oem_dev_data_s *edata = NULL;
        static char peer_path[DBUS_OBJECT_PATH_MAX] = {'\0',};
 
-    if(!g_pd) {
-        WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
-        return;
-        }
-
        edata = (wfd_oem_dev_data_s *) g_try_malloc0(sizeof(wfd_oem_dev_data_s));
        if (!edata) {
                WDP_LOGF("Failed to allocate memory for event. [%s]",
@@ -1146,11 +1141,6 @@ static void _ws_process_device_lost(GDBusConnection *connection,
        wfd_oem_event_s event;
        static char peer_path[DBUS_OBJECT_PATH_MAX] = {'\0',};
 
-    if(!g_pd) {
-        WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
-        return;
-        }
-
        memset(&event, 0x0, sizeof(wfd_oem_event_s));
 
        event.edata_type = WFD_OEM_EDATA_TYPE_NONE;
@@ -1169,11 +1159,6 @@ static void _ws_process_find_stoppped(GDBusConnection *connection,
        __WDP_LOG_FUNC_ENTER__;
        wfd_oem_event_s event;
 
-    if(!g_pd) {
-        WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
-        return;
-        }
-
        memset(&event, 0x0, sizeof(wfd_oem_event_s));
 
        event.edata_type = WFD_OEM_EDATA_TYPE_NONE;
@@ -1198,11 +1183,6 @@ static void _ws_process_prov_disc_req_display_pin(GDBusConnection *connection,
        const char *pin = NULL;
        char *loc = NULL;
 
-    if(!g_pd) {
-        WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
-        return;
-        }
-
        edata = (wfd_oem_dev_data_s *) g_try_malloc0(sizeof(wfd_oem_dev_data_s));
        if (!edata) {
                WDP_LOGF("Failed to allocate memory for event. [%s]",
@@ -1252,11 +1232,6 @@ static void _ws_process_prov_disc_resp_display_pin(GDBusConnection *connection,
        const char *pin = NULL;
        char *loc = NULL;
 
-    if(!g_pd) {
-        WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
-        return;
-        }
-
        edata = (wfd_oem_dev_data_s *) g_try_malloc0(sizeof(wfd_oem_dev_data_s));
        if (!edata) {
                WDP_LOGF("Failed to allocate memory for event. [%s]",
@@ -1300,11 +1275,6 @@ static void _ws_process_prov_disc_req_enter_pin(GDBusConnection *connection,
        wfd_oem_dev_data_s *edata = NULL;
        static char peer_path[DBUS_OBJECT_PATH_MAX] = {'\0',};
 
-    if(!g_pd) {
-        WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
-        return;
-        }
-
        edata = (wfd_oem_dev_data_s *) g_try_malloc0(sizeof(wfd_oem_dev_data_s));
        if (!edata) {
                WDP_LOGF("Failed to allocate memory for event. [%s]",
@@ -1338,11 +1308,6 @@ static void _ws_process_prov_disc_resp_enter_pin(GDBusConnection *connection,
        wfd_oem_dev_data_s *edata = NULL;
        static char peer_path[DBUS_OBJECT_PATH_MAX] = {'\0',};
 
-    if(!g_pd) {
-        WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
-        return;
-        }
-
        edata = (wfd_oem_dev_data_s *) g_try_malloc0(sizeof(wfd_oem_dev_data_s));
        if (!edata) {
                WDP_LOGF("Failed to allocate memory for event. [%s]",
@@ -1376,11 +1341,6 @@ static void _ws_process_prov_disc_pbc_req(GDBusConnection *connection,
        wfd_oem_dev_data_s *edata = NULL;
        static char peer_path[DBUS_OBJECT_PATH_MAX] = {'\0',};
 
-    if(!g_pd) {
-        WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
-        return;
-        }
-
        edata = (wfd_oem_dev_data_s *) g_try_malloc0(sizeof(wfd_oem_dev_data_s));
        if (!edata) {
                WDP_LOGF("Failed to allocate memory for event. [%s]",
@@ -1414,11 +1374,6 @@ static void _ws_process_prov_disc_pbc_resp(GDBusConnection *connection,
        wfd_oem_dev_data_s *edata = NULL;
        static char peer_path[DBUS_OBJECT_PATH_MAX] = {'\0',};
 
-    if(!g_pd) {
-        WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
-        return;
-        }
-
        edata = (wfd_oem_dev_data_s *) g_try_malloc0(sizeof(wfd_oem_dev_data_s));
        if (!edata) {
                WDP_LOGF("Failed to allocate memory for event. [%s]",
@@ -1455,11 +1410,6 @@ static void _ws_process_prov_disc_failure(GDBusConnection *connection,
        int prov_status = 0;
        char *loc = NULL;
 
-    if(!g_pd) {
-        WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
-        return;
-        }
-
        memset(&event, 0x0, sizeof(wfd_oem_event_s));
 
        event.edata_type = WFD_OEM_EDATA_TYPE_DEVICE;
@@ -1526,11 +1476,6 @@ static void _ws_process_go_neg_success(GDBusConnection *connection,
        wfd_oem_event_s event;
        wfd_oem_conn_data_s *edata = NULL;
 
-    if(!g_pd) {
-        WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
-        return;
-        }
-
        edata = (wfd_oem_conn_data_s*)calloc(1, sizeof(wfd_oem_conn_data_s));
        if (!edata) {
                WDP_LOGF("Failed to allocate memory for event. [%s]",
@@ -1612,11 +1557,6 @@ static void _ws_process_go_neg_request(GDBusConnection *connection,
 
        int dev_pwd_id = 0;
 
-    if(!g_pd) {
-        WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
-        return;
-        }
-
        edata = (wfd_oem_dev_data_s *) g_try_malloc0(sizeof(wfd_oem_dev_data_s));
        if (!edata) {
                WDP_LOGF("Failed to allocate memory for event. [%s]",
@@ -1670,11 +1610,6 @@ static void _ws_process_invitation_received(GDBusConnection *connection,
        wfd_oem_event_s event;
        wfd_oem_invite_data_s *edata = NULL;
 
-    if(!g_pd) {
-        WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
-        return;
-        }
-
        edata = (wfd_oem_invite_data_s *) g_try_malloc0(sizeof(wfd_oem_invite_data_s));
        if (!edata) {
                WDP_LOGF("Failed to allocate memory for event. [%s]",
@@ -1724,11 +1659,6 @@ static void _ws_process_group_finished(GDBusConnection *connection,
        __WDP_LOG_FUNC_ENTER__;
        wfd_oem_event_s event;
 
-    if(!g_pd) {
-        WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
-        return;
-        }
-
        memset(&event, 0x0, sizeof(wfd_oem_event_s));
 
        event.event_id = WFD_OEM_EVENT_GROUP_DESTROYED;
@@ -1751,11 +1681,6 @@ static void _ws_process_service_discovery_response(GDBusConnection *connection,
        GVariantIter *iter = NULL;
        wfd_oem_event_s event;
 
-    if(!g_pd) {
-        WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
-        return;
-        }
-
        memset(&event, 0x0, sizeof(wfd_oem_event_s));
 
        event.event_id = WFD_OEM_EVENT_SERV_DISC_RESP;
@@ -1812,11 +1737,6 @@ static void _ws_process_wps_failed(GDBusConnection *connection,
        wfd_oem_event_s event;
        const char *name = NULL;
 
-    if(!g_pd) {
-        WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
-        return;
-        }
-
        memset(&event, 0x0, sizeof(wfd_oem_event_s));
 
        event.event_id = WFD_OEM_EVENT_WPS_FAIL;
@@ -1850,11 +1770,6 @@ static void _ws_process_group_formation_failure(GDBusConnection *connection,
        __WDP_LOG_FUNC_ENTER__;
        wfd_oem_event_s event;
 
-    if(!g_pd) {
-        WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
-        return;
-        }
-
        memset(&event, 0x0, sizeof(wfd_oem_event_s));
 
        event.event_id = WFD_OEM_EVENT_WPS_FAIL;
@@ -1897,7 +1812,7 @@ static struct {
                _ws_process_prov_disc_resp_display_pin
        },
        {
-                       SUPPLICANT_P2PDEVICE,
+               SUPPLICANT_P2PDEVICE,
                "ProvisionDiscoveryRequestEnterPin",
                _ws_process_prov_disc_req_enter_pin
        },
@@ -1999,6 +1914,11 @@ static void _p2pdevice_signal_cb(GDBusConnection *connection,
        DEBUG_SIGNAL(sender, object_path, interface, signal, parameters);
 #endif /* TIZEN_DEBUG_DBUS_VALUE */
 
+       if (!g_pd) {
+               WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+               return;
+       }
+
        for (i = 0; ws_p2pdevice_signal_map[i].member != NULL; i++) {
                if (!g_strcmp0(signal, ws_p2pdevice_signal_map[i].member) &&
                                ws_p2pdevice_signal_map[i].function != NULL)
@@ -2046,38 +1966,38 @@ static void _group_signal_cb(GDBusConnection *connection,
        DEBUG_SIGNAL(sender, object_path, interface, signal, parameters);
 #endif /* TIZEN_DEBUG_DBUS_VALUE */
 
-    if(!g_pd) {
-        WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
-        return;
-        }
+       if (!g_pd) {
+               WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+               return;
+       }
 
-       if(!g_strcmp0(signal,"PeerJoined")){
+       if (!g_strcmp0(signal,"PeerJoined")) {
 
-                       wfd_oem_event_s event;
-                       wfd_oem_dev_data_s *edata = NULL;
+               wfd_oem_event_s event;
+               wfd_oem_dev_data_s *edata = NULL;
 
-                       static char peer_path[DBUS_OBJECT_PATH_MAX] = {'\0',};
+               static char peer_path[DBUS_OBJECT_PATH_MAX] = {'\0',};
 
-                       edata = (wfd_oem_dev_data_s *) g_try_malloc0(sizeof(wfd_oem_dev_data_s));
-                       if (!edata) {
-                               WDP_LOGF("Failed to allocate memory for event. [%s]",
-                                               strerror(errno));
-                               __WDP_LOG_FUNC_EXIT__;
-                               return;
-                       }
-                       memset(&event, 0x0, sizeof(wfd_oem_event_s));
+               edata = (wfd_oem_dev_data_s *) g_try_malloc0(sizeof(wfd_oem_dev_data_s));
+               if (!edata) {
+                       WDP_LOGF("Failed to allocate memory for event. [%s]",
+                                       strerror(errno));
+                       __WDP_LOG_FUNC_EXIT__;
+                       return;
+               }
+               memset(&event, 0x0, sizeof(wfd_oem_event_s));
 
-                       event.edata = (void*) edata;
-                       event.edata_type = WFD_OEM_EDATA_TYPE_DEVICE;
-                       event.event_id = WFD_OEM_EVENT_STA_CONNECTED;
+               event.edata = (void*) edata;
+               event.edata_type = WFD_OEM_EDATA_TYPE_DEVICE;
+               event.event_id = WFD_OEM_EVENT_STA_CONNECTED;
 
-                       __ws_parse_peer_joined(peer_path, event.dev_addr, event.ip_addr_peer, parameters);
+               __ws_parse_peer_joined(peer_path, event.dev_addr, event.ip_addr_peer, parameters);
 
-                       dbus_property_get_all(peer_path, g_pd->g_dbus, SUPPLICANT_P2P_PEER,
-                                               __ws_peer_property, event.edata);
+               dbus_property_get_all(peer_path, g_pd->g_dbus, SUPPLICANT_P2P_PEER,
+                               __ws_peer_property, event.edata);
 
-                       g_pd->callback(g_pd->user_data, &event);
-                       g_free(edata);
+               g_pd->callback(g_pd->user_data, &event);
+               g_free(edata);
 
        } else if (!g_strcmp0(signal,"PeerDisconnected")) {
 
@@ -2103,10 +2023,10 @@ static void __register_p2pdevice_signal(GVariant *value, void *user_data)
        static char interface_path[DBUS_OBJECT_PATH_MAX] = {'\0',};
        const char *path = NULL;
 
-    if(!g_pd) {
-        WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
-        return;
-        }
+       if (!g_pd) {
+               WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+               return;
+       }
 
        pd_data = (ws_dbus_plugin_data_s *)g_pd;
 
@@ -2139,10 +2059,10 @@ static int _ws_create_interface(const char *iface_name, handle_reply function, v
 
        int res = 0;
 
-    if(!g_pd) {
-        WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
-        return -1;
-        }
+       if (!g_pd) {
+               WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+               return -1;
+       }
 
        g_dbus = g_pd->g_dbus;
        if (!g_dbus) {
@@ -2175,10 +2095,10 @@ static int _ws_get_interface(const char *iface_name, handle_reply function, void
        dbus_method_param_s params;
        int res = 0;
 
-    if(!g_pd) {
-        WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
-        return -1;
-        }
+       if (!g_pd) {
+               WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+               return -1;
+       }
 
        g_dbus = g_pd->g_dbus;
        if (!g_dbus) {
@@ -2216,10 +2136,10 @@ static void __ws_remove_interface(GVariant *value, void *user_data)
        static char interface_path[DBUS_OBJECT_PATH_MAX] = {'\0',};
        int res = 0;
 
-    if(!g_pd) {
-        WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
-        return;
-        }
+       if (!g_pd) {
+               WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+               return;
+       }
 
        g_dbus = g_pd->g_dbus;
        if (!g_dbus) {
@@ -2254,10 +2174,10 @@ static int _ws_init_dbus_connection(void)
        GError *error = NULL;
        int res = 0;
 
-    if(!g_pd) {
-        WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
-        return -1;
-        }
+       if (!g_pd) {
+               WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+               return -1;
+       }
 
        conn = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &error);
 
@@ -2744,7 +2664,7 @@ int __ws_init_p2pdevice()
        int i = 0;
        int res = 0;
 
-       if(!g_pd) {
+       if (!g_pd) {
                WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
                return -1;
         }
@@ -2855,7 +2775,7 @@ int __ws_set_config_methods()
        dbus_method_param_s params;
        int res = 0;
 
-       if(!g_pd) {
+       if (!g_pd) {
                WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
                return -1;
        }
@@ -2891,10 +2811,10 @@ int ws_activate(int concurrent)
        int res = 0;
        int retry_count = 0;
 
-    if(!g_pd) {
-        WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
-        return -1;
-        }
+       if (!g_pd) {
+               WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+               return -1;
+       }
 
        res = __ws_p2p_supplicant_start();
        if (res < 0) {
@@ -2962,10 +2882,10 @@ int ws_deactivate(int concurrent)
        __WDP_LOG_FUNC_ENTER__;
        int res = 0;
 
-    if(!g_pd) {
-        WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
-        return -1;
-        }
+       if (!g_pd) {
+               WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+               return -1;
+       }
 
        if (!g_pd->activated) {
                WDP_LOGE("Wi-Fi Direct is not activated");
@@ -3023,7 +2943,7 @@ int ws_start_scan(wfd_oem_scan_param_s *param)
                return -1;
        }
 
-       if(!g_pd) {
+       if (!g_pd) {
                WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
                return -1;
        }
@@ -3079,7 +2999,7 @@ int ws_restart_scan(int freq)
        dbus_method_param_s params;
        int res = 0;
 
-       if(!g_pd) {
+       if (!g_pd) {
                WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
                return -1;
        }
@@ -3121,7 +3041,7 @@ int ws_stop_scan()
        dbus_method_param_s params;
        int res = 0;
 
-       if(!g_pd) {
+       if (!g_pd) {
                WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
                return -1;
        }
@@ -3183,7 +3103,7 @@ int ws_get_peer_info(unsigned char *peer_addr, wfd_oem_device_s **peer)
                return -1;
        }
 
-       if(!g_pd) {
+       if (!g_pd) {
                WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
                return -1;
        }
@@ -3237,7 +3157,7 @@ int ws_prov_disc_req(unsigned char *peer_addr, wfd_oem_wps_mode_e wps_mode, int
                return -1;
        }
 
-       if(!g_pd) {
+       if (!g_pd) {
                WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
                return -1;
        }
@@ -3287,7 +3207,7 @@ int ws_connect(unsigned char *peer_addr, wfd_oem_conn_param_s *param)
                return -1;
        }
 
-       if(!g_pd) {
+       if (!g_pd) {
                WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
                return -1;
        }
@@ -3354,7 +3274,7 @@ int ws_disconnect(unsigned char *peer_addr)
                return -1;
        }
 
-       if(!g_pd) {
+       if (!g_pd) {
                WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
                return -1;
        }
@@ -3403,7 +3323,7 @@ int ws_reject_connection(unsigned char *peer_addr)
                return -1;
        }
 
-       if(!g_pd) {
+       if (!g_pd) {
                WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
                return -1;
        }
@@ -3492,7 +3412,7 @@ int ws_generate_pin(char **pin)
        char n_pin[9] = {0,};
        int res = 0;
 
-       if(!g_pd) {
+       if (!g_pd) {
                WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
                return -1;
        }
@@ -3531,7 +3451,7 @@ static void __store_group_iface_path(GVariant *value, void *user_data) {
        ws_dbus_plugin_data_s * pd_data;
        const char *path = NULL;
 
-       if(!g_pd) {
+       if (!g_pd) {
                WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
                return;
        }
@@ -3554,7 +3474,7 @@ int ws_create_group(int persistent, int freq, const char *passphrase)
        dbus_method_param_s params;
        int res = 0;
 
-       if(!g_pd) {
+       if (!g_pd) {
                WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
                return -1;
        }
@@ -3615,7 +3535,7 @@ int ws_destroy_group(const char *ifname)
                return -1;
        }
 
-       if(!g_pd) {
+       if (!g_pd) {
                WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
                return -1;
        }
@@ -3665,7 +3585,7 @@ int ws_invite(unsigned char *peer_addr, wfd_oem_invite_param_s *param)
                return -1;
        }
 
-       if(!g_pd) {
+       if (!g_pd) {
                WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
                return -1;
        }
@@ -3714,7 +3634,7 @@ int ws_wps_start(unsigned char *peer_addr, int wps_mode, const char *pin)
        int i = 0;
        int res = 0;
 
-       if(!g_pd) {
+       if (!g_pd) {
                WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
                return -1;
        }
@@ -3828,7 +3748,7 @@ int ws_set_dev_name(char *dev_name)
                return -1;
        }
 
-       if(!g_pd) {
+       if (!g_pd) {
                WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
                return -1;
        }
@@ -3908,7 +3828,7 @@ int ws_get_go_intent(int *go_intent)
                return -1;
        }
 
-       if(!g_pd) {
+       if (!g_pd) {
                WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
                return -1;
        }
@@ -3981,7 +3901,7 @@ int ws_set_go_intent(int go_intent)
        dbus_method_param_s params;
        int res = 0;
 
-       if(!g_pd) {
+       if (!g_pd) {
                WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
                return -1;
        }
@@ -4030,7 +3950,7 @@ int ws_set_country(char *ccode)
        dbus_method_param_s params;
        int res = 0;
 
-       if(!g_pd) {
+       if (!g_pd) {
                WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
                return -1;
        }
@@ -4151,7 +4071,7 @@ int ws_get_persistent_groups(wfd_oem_persistent_group_s **groups, int *group_cou
        wfd_oem_persistent_group_s *wfd_persistent_groups = NULL;
        int i, cnt = 0;
 
-       if(!g_pd) {
+       if (!g_pd) {
                WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
                return -1;
        }
@@ -4214,7 +4134,7 @@ int ws_remove_persistent_group(char *ssid, unsigned char *bssid)
        int i, cnt = 0;
        int res = 0;
 
-       if(!g_pd) {
+       if (!g_pd) {
                WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
                return -1;
        }
@@ -4287,7 +4207,7 @@ int ws_set_persistent_reconnect(unsigned char *bssid, int reconnect)
        dbus_method_param_s params;
        int res = 0;
 
-       if(!g_pd) {
+       if (!g_pd) {
                WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
                return -1;
        }
@@ -4560,7 +4480,7 @@ int ws_start_service_discovery(unsigned char *mac_addr, int service_type)
        int i = 0;
        int res = 0;
 
-       if(!g_pd) {
+       if (!g_pd) {
                WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
                return -1;
        }
@@ -4642,7 +4562,7 @@ int ws_cancel_service_discovery(unsigned char *mac_addr, int service_type)
 
        int res = 0;
 
-       if(!g_pd) {
+       if (!g_pd) {
                WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
                return -1;
        }
@@ -4711,7 +4631,7 @@ int ws_serv_add(wfd_oem_new_service_s *service)
        dbus_method_param_s params;
        int res = 0;
 
-       if(!g_pd) {
+       if (!g_pd) {
                WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
                return -1;
        }
@@ -4774,7 +4694,7 @@ int ws_serv_del(wfd_oem_new_service_s *service)
        dbus_method_param_s params;
        int res = 0;
 
-       if(!g_pd) {
+       if (!g_pd) {
                WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
                return -1;
        }
@@ -4839,7 +4759,7 @@ int _ws_disable_display()
        dbus_method_param_s params;
        int res = 0;
 
-       if(!g_pd) {
+       if (!g_pd) {
                WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
                return -1;
        }