{
char sto_path[MTP_MAX_PATHNAME_SIZE + 1] = { 0 };
- switch(store_id) {
- case MTP_INTERNAL_STORE_ID :
+ switch (store_id) {
+ case MTP_INTERNAL_STORE_ID:
_util_get_internal_path(sto_path);
g_strlcpy(path, sto_path,
MTP_MAX_PATHNAME_SIZE + 1);
break;
- case MTP_EXTERNAL_STORE_ID :
+ case MTP_EXTERNAL_STORE_ID:
_util_get_external_path(sto_path);
g_strlcpy(path, sto_path,
MTP_MAX_PATHNAME_SIZE + 1);
break;
- default :
+ default:
ERR("No valid match for the store id [0x%x]\n", store_id);
return FALSE;
/* references */
if (PTP_OBJECTHANDLE_ROOT != obj->obj_info->h_parent) {
par_obj = _entity_get_object_from_store(store, obj->obj_info->h_parent);
- if (NULL != par_obj) {
+ if (NULL != par_obj)
_entity_add_reference_child_array(par_obj, obj->obj_handle);
- }
}
return TRUE;
return NULL;
}
- while(UTIL_CHECK_LIST_NEXT(iter) == TRUE) {
+ while (UTIL_CHECK_LIST_NEXT(iter) == TRUE) {
obj = (mtp_obj_t *)_util_get_list_next(iter);
if (obj && obj->obj_handle == handle) {
return NULL;
}
- while(UTIL_CHECK_LIST_NEXT(iter) == TRUE) {
+ while (UTIL_CHECK_LIST_NEXT(iter) == TRUE) {
temp_obj = (mtp_obj_t *)_util_get_list_next(iter);
- if (temp_obj && temp_obj->obj_handle == handle) {
+ if (temp_obj && temp_obj->obj_handle == handle)
obj = temp_obj;
- }
}
_util_deinit_list_iterator(iter);
return NULL;
}
- while(UTIL_CHECK_LIST_NEXT(iter) == TRUE) {
+ while (UTIL_CHECK_LIST_NEXT(iter) == TRUE) {
obj = (mtp_obj_t *)_util_get_list_next(iter);
if (obj == NULL) {
ERR("Object is NULL");
return 0;
}
- while(UTIL_CHECK_LIST_NEXT(iter) == TRUE) {
+ while (UTIL_CHECK_LIST_NEXT(iter) == TRUE) {
obj = (mtp_obj_t *)_util_get_list_next(iter);
if (obj == NULL) {
if ((fmt == obj->obj_info->obj_fmt) ||
(fmt == PTP_FORMATCODE_ALL) ||
(fmt == PTP_FORMATCODE_NOTUSED)) {
- _prop_append_ele_ptparray(obj_arr, (mtp_uint32)obj);
+ _prop_append_ele_ptparray(obj_arr, obj->obj_handle);
}
}
_util_deinit_list_iterator(iter);
mtp_uint32 obj_handle, mtp_uint32 fmt_code, mtp_uint32 depth,
ptp_array_t *obj_arr)
{
- mtp_obj_t *obj = NULL;
-
retv_if(store == NULL, 0);
retv_if(obj_arr == NULL, 0);
return obj_arr->num_ele;
}
- if (PTP_OBJECTHANDLE_ROOT != obj_handle) {
- obj = _entity_get_object_from_store(store, obj_handle);
- if (obj) {
- _prop_append_ele_ptparray(obj_arr, (mtp_uint32)obj);
- }
- }
+ if (PTP_OBJECTHANDLE_ROOT != obj_handle)
+ _prop_append_ele_ptparray(obj_arr, obj_handle);
+
if (depth > 0) {
ptp_array_t *child_arr = NULL;
mtp_uint32 *ptr = NULL;
return 0;
}
- while(UTIL_CHECK_LIST_NEXT(iter) == TRUE) {
+ while (UTIL_CHECK_LIST_NEXT(iter) == TRUE) {
obj = (mtp_obj_t *)_util_get_list_next(iter);
if (obj == NULL || obj->obj_info == NULL)
retv_if(store == NULL, 0);
- if (PTP_FORMATCODE_NOTUSED == format) {
+ if (PTP_FORMATCODE_NOTUSED == format)
return store->obj_list.nnodes;
- }
iter = (slist_iterator *)_util_init_list_iterator(&(store->obj_list));
if (iter == NULL) {
return 0;
}
- while(UTIL_CHECK_LIST_NEXT(iter) == TRUE) {
+ while (UTIL_CHECK_LIST_NEXT(iter) == TRUE) {
obj = (mtp_obj_t *)_util_get_list_next(iter);
if (obj == NULL || obj->obj_info == NULL)
return 0;
}
- while(UTIL_CHECK_LIST_NEXT(iter) == TRUE) {
+ while (UTIL_CHECK_LIST_NEXT(iter) == TRUE) {
obj = (mtp_obj_t *)_util_get_list_next(iter);
if (obj == NULL || obj->obj_info == NULL)
return 0;
}
- while(UTIL_CHECK_LIST_NEXT(iter) == TRUE) {
+ while (UTIL_CHECK_LIST_NEXT(iter) == TRUE) {
obj = (mtp_obj_t *)_util_get_list_next(iter);
if (obj == NULL || obj->obj_info == NULL)
continue;
- if (obj->obj_info->h_parent == h_parent) {
+ if (obj->obj_info->h_parent == h_parent)
_prop_append_ele_ptparray(child_arr, obj->obj_handle);
- }
}
_util_deinit_list_iterator(iter);
return 0;
}
- while(UTIL_CHECK_LIST_NEXT(iter) == TRUE) {
+ while (UTIL_CHECK_LIST_NEXT(iter) == TRUE) {
obj = (mtp_obj_t *)_util_get_list_next(iter);
if (obj == NULL || obj->obj_info == NULL)
child_obj = _entity_get_object_from_store(store,
ptr32[i]);
- if (NULL == child_obj) {
+ if (NULL == child_obj)
continue;
- }
+
if (_entity_remove_object_mtp_store(store, child_obj,
format, response, atleast_one,
read_only)) {
DBG_SECURE("Folder[%s] contains only read-only files\n",
obj->file_path);
all_del = FALSE;
- } else if (num_of_deleted_file < num_of_file){
+ } else if (num_of_deleted_file < num_of_file) {
DBG("num of files[%d] is present in folder[%s]\
and number of deleted files[%d]\n",
num_of_file, obj->file_path,
obj->obj_handle);
}
}
- } else if(*atleast_one) {
+ } else if (*atleast_one) {
*response = PTP_RESPONSE_PARTIAL_DELETION;
return FALSE;
} else {
}
}
- if (all_del) {
+ if (all_del)
response = PTP_RESPONSE_OK;
- } else if (atleas_one)
+ else if (atleas_one)
response = PTP_RESPONSE_PARTIAL_DELETION;
return response;
do {
if (TRUE == _transport_get_usb_discon_state()) {
DBG("USB is disconnected");
- if (closedir(h_dir) < 0) {
+ if (closedir(h_dir) < 0)
ERR("Close directory Fail");
- }
+
return;
}
&entry);
} while (status);
- if (closedir(h_dir) < 0) {
+ if (closedir(h_dir) < 0)
ERR("close directory fail");
- }
+
#ifdef MTP_SUPPORT_OBJECTADDDELETE_EVENT
_inoti_add_watch_for_fs_events(folder_name);
#endif /*MTP_SUPPORT_OBJECTADDDELETE_EVENT*/