From e05c912b04661c5577a04f5064f76544d9ba9fa4 Mon Sep 17 00:00:00 2001 From: hyunuktak Date: Mon, 7 Nov 2016 15:11:36 +0900 Subject: [PATCH] Fixed coding rule issues Change-Id: Ia4380b3fcc89e1f332f45ebfa809356f7975029c Signed-off-by: hyunuktak --- packaging/net-config.spec | 2 +- src/dbus/netdbus.c | 2 +- src/network-monitor.c | 12 ++++++------ src/signal-handler.c | 2 +- src/utils/util.c | 3 ++- src/wifi-background-scan.c | 2 +- src/wifi-config.c | 10 +++++----- src/wifi-power.c | 2 +- src/wifi-ssid-scan.c | 8 ++++---- src/wifi-state.c | 3 +-- src/wifi-wps.c | 6 ++---- 11 files changed, 25 insertions(+), 27 deletions(-) diff --git a/packaging/net-config.spec b/packaging/net-config.spec index 16ecae3..e07cd5b 100755 --- a/packaging/net-config.spec +++ b/packaging/net-config.spec @@ -1,6 +1,6 @@ Name: net-config Summary: TIZEN Network Configuration service -Version: 1.1.92 +Version: 1.1.93 Release: 2 Group: System/Network License: Apache-2.0 diff --git a/src/dbus/netdbus.c b/src/dbus/netdbus.c index 7e78176..c982aea 100755 --- a/src/dbus/netdbus.c +++ b/src/dbus/netdbus.c @@ -324,7 +324,7 @@ int setup_gdbus(got_name_cb cb) exit(1); } - manager_server_vpn= g_dbus_object_manager_server_new(NETCONFIG_VPNSVC_PATH); + manager_server_vpn = g_dbus_object_manager_server_new(NETCONFIG_VPNSVC_PATH); if (manager_server_vpn == NULL) { ERR("Manager server for VPNSVC_PATH not created."); exit(1); diff --git a/src/network-monitor.c b/src/network-monitor.c index bce7bfe..21e6de7 100755 --- a/src/network-monitor.c +++ b/src/network-monitor.c @@ -45,9 +45,9 @@ int netconfig_ethernet_cable_plugin_status_check() int ret = -1; FILE *fd = NULL; char error_buf[MAX_SIZE_ERROR_BUFFER] = {0, }; - if(0 == access(ETHERNET_CABLE_STATUS, F_OK)) { + if (0 == access(ETHERNET_CABLE_STATUS, F_OK)) { fd = fopen(ETHERNET_CABLE_STATUS, "r"); - if(fd == NULL) { + if (fd == NULL) { ERR("Error! Could not open /sys/class/net/eth0/carrier file\n"); return -1; } @@ -59,21 +59,21 @@ int netconfig_ethernet_cable_plugin_status_check() int rv = 0; errno = 0; rv = fscanf(fd, "%d", &ret); - if(rv < 0) { + if (rv < 0) { strerror_r(errno, error_buf, MAX_SIZE_ERROR_BUFFER); ERR("Error! Failed to read from file, rv:[%d], error:[%s]", rv, error_buf); fclose(fd); return -1; } - if(ret == 1) { - if(!g_chk_eth_send_notification) { + if (ret == 1) { + if (!g_chk_eth_send_notification) { ERR("/sys/class/net/eth0/carrier : [%d]", ret); netconfig_network_notify_ethernet_cable_state("ATTACHED"); } g_chk_eth_send_notification = TRUE; } else if (ret == 0) { - if(g_chk_eth_send_notification) { + if (g_chk_eth_send_notification) { ERR("/sys/class/net/eth0/carrier : [%d]", ret); netconfig_network_notify_ethernet_cable_state("DETACHED"); } diff --git a/src/signal-handler.c b/src/signal-handler.c index 304234d..616448c 100755 --- a/src/signal-handler.c +++ b/src/signal-handler.c @@ -524,7 +524,7 @@ static void _supplicant_session_overlapped(GDBusConnection *conn, { DBG("Driver session overlapped handling!"); ERR("WPS PBC SESSION OVERLAPPED"); -#if defined TIZEN_WEARABLE +#if defined TIZEN_WEARABLE return; #else netconfig_send_message_to_net_popup("WPS Error", diff --git a/src/utils/util.c b/src/utils/util.c index 9755f48..8376291 100755 --- a/src/utils/util.c +++ b/src/utils/util.c @@ -773,7 +773,8 @@ gboolean handle_launch_direct(Wifi *wifi, GDBusMethodInvocation *context) #endif } -int execute_mdnsd_script(char* op) { +int execute_mdnsd_script(char* op) +{ const char *path = "/usr/bin/mdnsresponder-server.sh"; char *const args[] = { "mdnsresponder-server.sh", op, NULL }; char *const envs[] = { NULL }; diff --git a/src/wifi-background-scan.c b/src/wifi-background-scan.c index 9894809..8172fdf 100755 --- a/src/wifi-background-scan.c +++ b/src/wifi-background-scan.c @@ -92,7 +92,7 @@ static void __netconfig_wifi_scan_request_reply(GObject *source_object, GAsyncRe GDBusConnection *conn = NULL; GError *error = NULL; - conn = G_DBUS_CONNECTION (source_object); + conn = G_DBUS_CONNECTION(source_object); reply = g_dbus_connection_call_finish(conn, res, &error); if (reply == NULL) { diff --git a/src/wifi-config.c b/src/wifi-config.c index 080fb6f..1c590dd 100755 --- a/src/wifi-config.c +++ b/src/wifi-config.c @@ -619,7 +619,7 @@ gboolean handle_get_config_ids(Wifi *wifi, GDBusMethodInvocation *context) wifi_complete_get_config_ids(wifi, context, (const gchar * const *)result); for (i = 0; i < length; i++) - if(result[i]) + if (result[i]) g_free(result[i]); if (result) @@ -811,14 +811,14 @@ gboolean handle_load_eap_configuration(Wifi *wifi, GDBusMethodInvocation *contex g_variant_builder_add(b, "{sv}", WIFI_CONFIG_NAME, g_variant_new_string(conf->name)); g_variant_builder_add(b, "{sv}", WIFI_CONFIG_SECURITY_TYPE, g_variant_new_string(conf->security_type)); g_variant_builder_add(b, "{sv}", WIFI_CONFIG_HIDDEN, g_variant_new_string(conf->is_hidden)); - if (conf->proxy_address != NULL) { + if (conf->proxy_address != NULL) g_variant_builder_add(b, "{sv}", WIFI_CONFIG_PROXYADDRESS, g_variant_new_string(conf->proxy_address)); - } else + else g_variant_builder_add(b, "{sv}", WIFI_CONFIG_PROXYADDRESS, g_variant_new_string("NONE")); - if (conf->last_error != NULL) { + if (conf->last_error != NULL) g_variant_builder_add(b, "{sv}", WIFI_CONFIG_FAILURE, g_variant_new_string(conf->last_error)); - } else + else g_variant_builder_add(b, "{sv}", WIFI_CONFIG_FAILURE, g_variant_new_string("ERROR_NONE")); if (conf->eap_config != NULL) { diff --git a/src/wifi-power.c b/src/wifi-power.c index 535203c..2ef365e 100755 --- a/src/wifi-power.c +++ b/src/wifi-power.c @@ -98,7 +98,7 @@ static void __technology_reply(GObject *source_object, GAsyncResult *res, gpoint GDBusConnection *conn = NULL; GError *error = NULL; - conn = G_DBUS_CONNECTION (source_object); + conn = G_DBUS_CONNECTION(source_object); reply = g_dbus_connection_call_finish(conn, res, &error); if (reply == NULL) { diff --git a/src/wifi-ssid-scan.c b/src/wifi-ssid-scan.c index e6ba5f4..d07a0f2 100755 --- a/src/wifi-ssid-scan.c +++ b/src/wifi-ssid-scan.c @@ -217,7 +217,7 @@ static void _emit_ssid_scan_completed(void) gboolean wps = bss_info->wps; DBG("BSS found; SSID:%s security:%d WPS:%d", ssid, security, wps); - if(bssid) { + if (bssid) { snprintf(bssid_str, sizeof(bssid_buf), MACSTR, MAC2STR(bssid)); DBG("BSSID: %s", bssid_str); } @@ -361,13 +361,13 @@ void wifi_ssid_scan_add_bss(GVariant *message) gsize ie_len; ie = g_variant_get_fixed_array(value, &ie_len, sizeof(guchar)); DBG("The IE : %s", ie); - } else if(g_strcmp0(key, "BSSID") == 0) { + } else if (g_strcmp0(key, "BSSID") == 0) { const guchar *bssid; gsize bssid_len; bssid = g_variant_get_fixed_array(value, &bssid_len, sizeof(guchar)); - if(bssid != NULL && bssid_len == 6) - memcpy(bss_info->bssid,bssid,bssid_len); + if (bssid != NULL && bssid_len == 6) + memcpy(bss_info->bssid, bssid, bssid_len); } } diff --git a/src/wifi-state.c b/src/wifi-state.c index fbafbd9..95618f4 100755 --- a/src/wifi-state.c +++ b/src/wifi-state.c @@ -585,9 +585,8 @@ void wifi_state_set_service_state(wifi_service_state_e new_state) _wifi_state_changed(new_state); - if (new_state == NETCONFIG_WIFI_CONNECTED) { + if (new_state == NETCONFIG_WIFI_CONNECTED) _wifi_state_connected_activation(); - } } wifi_service_state_e wifi_state_get_service_state(void) diff --git a/src/wifi-wps.c b/src/wifi-wps.c index 618a2c6..544751e 100755 --- a/src/wifi-wps.c +++ b/src/wifi-wps.c @@ -400,15 +400,13 @@ static void __netconfig_wifi_interface_create_result( __netconfig_wifi_wps_request_scan(path); g_free(path); } - } - else if (NULL != strstr(error->message, ".InterfaceExists")) { + } else if (NULL != strstr(error->message, ".InterfaceExists")) { INFO("Error Message %s %s", error->message, path); g_variant_get(message, "(o)", &path); if (path) { __netconfig_wifi_wps_request_scan(path); g_free(path); - } - else + } else __netconfig_wifi_wps_request_scan(NULL); } else { ERR("Failed to create interface, Error: %d[%s]", error->code, error->message); -- 2.7.4