DPM: Fix DPM GCC6 warning errors. 45/105345/1 submit/tizen/20161219.111502 submit/tizen/20170112.021958
authorh.sandeep <h.sandeep@samsung.com>
Fri, 16 Dec 2016 08:25:09 +0000 (13:55 +0530)
committerh.sandeep <h.sandeep@samsung.com>
Fri, 16 Dec 2016 08:27:16 +0000 (13:57 +0530)
Change-Id: I152f2a1a11757ef180655e27d063510a47847fd5
Signed-off-by: h.sandeep <h.sandeep@samsung.com>
bt-service/bt-service-dpm.c

index 27cb1f2..908f12c 100644 (file)
 #include "bt-service-dpm.h"
 
 static dpm_policy_t policy_table[DPM_POLICY_END] = {
-       [DPM_POLICY_ALLOW_BLUETOOTH] = { {DPM_BT_ERROR} },
-       [DPM_POLICY_BLUETOOTH_DEVICE_RESTRICTION] = { {DPM_STATUS_ERROR} },
-       [DPM_POLICY_BLUETOOTH_UUID_RESTRICTION] = { {DPM_STATUS_ERROR} },
-       [DPM_POLICY_BLUETOOTH_DEVICES_WHITELIST] = { {NULL} },
-       [DPM_POLICY_BLUETOOTH_DEVICES_BLACKLIST] = { {NULL} },
-       [DPM_POLICY_BLUETOOTH_UUIDS_WHITELIST] = { {NULL} },
-       [DPM_POLICY_BLUETOOTH_UUIDS_BLACKLIST] = { {NULL} },
-       [DPM_POLICY_ALLOW_BLUETOOTH_OUTGOING_CALL] = { {DPM_STATUS_ERROR} },
-       [DPM_POLICY_BLUETOOTH_PAIRING_STATE] = { {DPM_STATUS_ERROR} },
-       [DPM_POLICY_BLUETOOTH_DESKTOP_CONNECTIVITY_STATE] = { {DPM_STATUS_ERROR} },
-       [DPM_POLICY_BLUETOOTH_DISCOVERABLE_STATE] = { {DPM_STATUS_ERROR} },
-       [DPM_POLICY_BLUETOOTH_LIMITED_DISCOVERABLE_STATE] = { {DPM_STATUS_ERROR} },
-       [DPM_POLICY_BLUETOOTH_DATA_TRANSFER_STATE] = { {DPM_STATUS_ERROR} },
+       [DPM_POLICY_ALLOW_BLUETOOTH] = { {DPM_BT_ERROR, NULL} },
+       [DPM_POLICY_BLUETOOTH_DEVICE_RESTRICTION] = { {DPM_STATUS_ERROR, NULL} },
+       [DPM_POLICY_BLUETOOTH_UUID_RESTRICTION] = { {DPM_STATUS_ERROR, NULL} },
+       [DPM_POLICY_BLUETOOTH_DEVICES_WHITELIST] = { {DPM_STATUS_ERROR, NULL} },
+       [DPM_POLICY_BLUETOOTH_DEVICES_BLACKLIST] = { {DPM_STATUS_ERROR, NULL} },
+       [DPM_POLICY_BLUETOOTH_UUIDS_WHITELIST] = { {DPM_STATUS_ERROR, NULL} },
+       [DPM_POLICY_BLUETOOTH_UUIDS_BLACKLIST] = { {DPM_STATUS_ERROR, NULL} },
+       [DPM_POLICY_ALLOW_BLUETOOTH_OUTGOING_CALL] = { {DPM_STATUS_ERROR, NULL} },
+       [DPM_POLICY_BLUETOOTH_PAIRING_STATE] = { {DPM_STATUS_ERROR, NULL} },
+       [DPM_POLICY_BLUETOOTH_DESKTOP_CONNECTIVITY_STATE] = { {DPM_STATUS_ERROR, NULL} },
+       [DPM_POLICY_BLUETOOTH_DISCOVERABLE_STATE] = { {DPM_STATUS_ERROR, NULL} },
+       [DPM_POLICY_BLUETOOTH_LIMITED_DISCOVERABLE_STATE] = { {DPM_STATUS_ERROR, NULL} },
+       [DPM_POLICY_BLUETOOTH_DATA_TRANSFER_STATE] = { {DPM_STATUS_ERROR, NULL} },
 };
 
 
@@ -481,9 +481,10 @@ int _bt_dpm_clear_bluetooth_uuids_from_blacklist(void)
 
        for (l = policy_table[DPM_POLICY_BLUETOOTH_UUIDS_BLACKLIST].list; l; l = g_slist_next(l)) {
                char *l_uuid = l->data;
-               if (l_uuid)
+               if (l_uuid) {
                        policy_table[DPM_POLICY_BLUETOOTH_UUIDS_BLACKLIST].list = g_slist_remove(policy_table[DPM_POLICY_BLUETOOTH_UUIDS_BLACKLIST].list, l_uuid);
                        g_free(l_uuid);
+               }
        }
        g_slist_free(policy_table[DPM_POLICY_BLUETOOTH_UUIDS_BLACKLIST].list);
        policy_table[DPM_POLICY_BLUETOOTH_UUIDS_BLACKLIST].list = NULL;