#define UTIL_LOCK_MUTEX(mut)\
do {\
int lock_ret = 0;\
- DBG("Thread [%d] trying to lock the Mutex \n", syscall(__NR_gettid));\
+ DBG("Thread [%ld] trying to lock the Mutex \n", syscall(__NR_gettid));\
lock_ret = pthread_mutex_lock(mut);\
if (lock_ret != 0) {\
if (lock_ret == EDEADLK) {\
ERR("Error locking mutex. Error = %d \n", lock_ret);\
} \
} else {\
- DBG("Mutex locked by thread [%d] \n", syscall(__NR_gettid));\
+ DBG("Mutex locked by thread [%ld] \n", syscall(__NR_gettid));\
} \
} while (0);\
if (unlock_ret != 0) {\
ERR("Error unlocking mutex. Error = %d \n", unlock_ret);\
} else {\
- DBG("Mutex unlocked by thread [%d] \n", syscall(__NR_gettid));\
+ DBG("Mutex unlocked by thread [%ld] \n", syscall(__NR_gettid));\
} \
} while (0);\
_prop_init_ptparray(&child_arr, UINT32_TYPE);
_entity_get_child_handles(src_store, obj->obj_handle, &child_arr);
- DBG("obj_handle[%d], src_path[%s], dest_path[%s], num elements[%ld]\n",
+ DBG("obj_handle[%d], src_path[%s], dest_path[%s], num elements[%u]\n",
obj->obj_handle, src_path, dest_path, child_arr.num_ele);
for (idx = 0; idx < child_arr.num_ele; idx++) {
_prop_init_ptparray(&child_arr, UINT32_TYPE);
_entity_get_child_handles(src_store, obj->obj_handle, &child_arr);
- DBG("Object handle[%ld], src_path[%s], dest_path[%s], Numchild[%ld]\n",
+ DBG("Object handle[%u], src_path[%s], dest_path[%s], Numchild[%u]\n",
obj->obj_handle, src_path, dest_path, child_arr.num_ele);
for (idx = 0; idx < child_arr.num_ele; idx++) {
child_obj = _entity_get_object_from_store(src_store, child_handle_arr[idx]);
if (NULL == child_obj)
continue;
- DBG_SECURE("obj_handle[%ld], full path[%s]\n", child_obj->obj_handle,
+ DBG_SECURE("obj_handle[%u], full path[%s]\n", child_obj->obj_handle,
child_obj->file_path);
g_strlcpy(temp_child_path, child_obj->file_path,
sizeof(temp_child_path));
}
} else {
- DBG("object handle is not PTP_OBJECTHANDLE_ALL. [%ld]\n",
+ DBG("object handle is not PTP_OBJECTHANDLE_ALL. [%u]\n",
obj_handle);
obj = _entity_get_object_from_store(store, obj_handle);
code = tmp->code;
trid = tmp->tid;
- DBG("len[%ld], type[0x%x], code [0x%x], trid[0x%x]\n",
+ DBG("len[%lu], type[0x%x], code [0x%x], trid[0x%lu]\n",
len, type, code, trid);
if (_hdlr_validate_cmd_container((mtp_byte *)tmp, len)
/* ignore other case */
ERR("MTP device phase[%d], unknown device PHASE\n",
_device_get_phase());
- ERR("PhaseUnknown-> pData[0x%x], length=[%d]", buffer, buf_len);
+ ERR("PhaseUnknown-> pData[0x%p], length=[%d]", buffer, buf_len);
_device_set_phase(DEVICE_PHASE_IDLE);
_transport_set_mtp_operation_state(MTP_STATE_ONSERVICE);
}
}
if (store->store_info.free_space < obj_info->file_size) {
- ERR("free space is not enough [%ld] bytes, object size[%ld]\n",
+ ERR("free space is not enough [%llu] bytes, object size[%llu]\n",
store->store_info.free_space, obj_info->file_size);
_entity_dealloc_obj_info(obj_info);
return MTP_ERROR_STORE_FULL;
if (file_exist == FALSE) {
DBG_SECURE("Found a unique file name for the incoming object\
- [%s]\n", temp_wfname);
+ [0x%p]\n", temp_wfname);
break;
}
if ((store->store_info.free_space) == 0 ||
(store->store_info.free_space >
store->store_info.capacity)) {
- ERR("free space is not enough [%ld:%ld]\n",
+ ERR("free space is not enough [%llu:%llu]\n",
store->store_info.free_space,
store->store_info.capacity);
return MTP_ERROR_STORE_FULL;
if ((store->store_info.free_space) == 0 ||
(store->store_info.free_space > store->store_info.capacity)) {
- ERR("free space is not enough [%ld bytes]\n",
+ ERR("free space is not enough [%llu bytes]\n",
store->store_info.free_space);
return MTP_ERROR_STORE_FULL;
}
if (store->store_info.free_space <= obj_sz) {
- ERR("free space is not enough [%ld bytes]\n",
+ ERR("free space is not enough [%llu bytes]\n",
store->store_info.free_space);
return MTP_ERROR_STORE_FULL;
}
switch (ptp_event) {
case PTP_EVENTCODE_STOREADDED:
DBG("case PTP_EVENTCODE_STOREADDED:");
- DBG("store_id [0x%x]\n", store_id);
+ DBG("store_id [0x%lu]\n", store_id);
_hdlr_init_event_container(&event, PTP_EVENTCODE_STOREADDED, 0,
store_id, 0);
break;
case PTP_EVENTCODE_STOREREMOVED:
DBG("case PTP_EVENTCODE_STOREREMOVED");
- DBG("store_id [0x%x]\n", store_id);
+ DBG("store_id [0x%lu]\n", store_id);
_hdlr_init_event_container(&event,
PTP_EVENTCODE_STOREREMOVED, 0, store_id, 0);
break;
ERR("HEADER FAILURE");
ERR("HEADER length[%d], Type[%d], Code[%d], tid[%d]\n",
dst->len, dst->type, dst->code, dst->tid);
- ERR("EXPECTED length[%d], Type[%d], Code[%d], tid[%d]\n",
+ ERR("EXPECTED length[%llu], Type[%d], Code[%d], tid[%d]\n",
bytes_rcvd, CONTAINER_DATA_BLK, exp_code, exp_tid);
return FALSE;
}
}
}
- ERR("thread_data_rcv[%u] exiting\n", g_data_rcv);
+ ERR("thread_data_rcv[%lu] exiting\n", g_data_rcv);
_util_thread_exit("__transport_thread_data_rcv is over");
return NULL;
}
DBG(__FILE__ "(%s):%d: USB_PTPREQUEST_%s",
__func__, __LINE__, requests[ctrl->bRequest-0x64]);
if (wValue != 0 || wIndex != 0 || wLength != 6) {
- DBG("Invalid request parameters: wValue:%d wIndex:%d wLength:%d\n");
+ DBG("Invalid request parameters: wValue:%hu wIndex:%hu wLength:%hu\n", wIndex, wValue, wLength);
rc = -EINVAL;
goto stall;
}
if (status != -1 || errno != EL2HLT) {
ERR(__FILE__"(%s):%d:stall error\n",
- __func__, __LINE__, ctrl->bRequestType, ctrl->bRequest);
+ __func__, __LINE__);
rc = errno;
}
return rc;
memcpy(&(cancelreq_data.io_code), buffer, sizeof(mtp_word));
memcpy(&(cancelreq_data.tid), &buffer[2], sizeof(mtp_dword));
- DBG("cancel io code [%d], transaction id [%ld]\n",
+ DBG("cancel io code [%d], transaction id [%du]\n",
cancelreq_data.io_code, cancelreq_data.tid);
break;
res = pthread_join(tid, data);
if (res != 0) {
- ERR("pthread_join Fail res = [%d] for thread [%u] errno [%d]\n",
+ ERR("pthread_join Fail res = [%d] for thread [%lu] errno [%d]\n",
res, tid, errno); // LCOV_EXCL_LINE
return FALSE; // LCOV_EXCL_LINE
}
res = pthread_cancel(tid);
if (res != 0) {
- ERR("pthread_cancel Fail [%d] errno [%d]\n", tid, errno);
+ ERR("pthread_cancel Fail [%lu] errno [%d]\n", tid, errno);
return FALSE;
}