Commit 43b340cf authored by Suman Anna's avatar Suman Anna Committed by Hari Kanigeri

SYSLINK: ipc - removed gt_traces from messageq_transportshm & heapbuf modules

This patch cleaned up all the gt_traces in messageq_transportshm and heapbuf
modules. Duplicate BUG_ONs have also been removed. return statements have
been added in couple of functions for successful execution scenarions.
Signed-off-by: default avatarSuman Anna <s-anna@ti.com>
parent 7ef35685
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/bug.h> #include <linux/bug.h>
#include <gt.h>
#include <heap.h> #include <heap.h>
...@@ -33,9 +33,6 @@ void *heap_alloc(void *hphandle, u32 size, u32 align) ...@@ -33,9 +33,6 @@ void *heap_alloc(void *hphandle, u32 size, u32 align)
char *block = NULL; char *block = NULL;
struct heap_object *obj = NULL; struct heap_object *obj = NULL;
gt_3trace(heap_debugmask, GT_6CLASS, "heap_alloc:\n"
"hphandle: %x, size: %x, align: %x \n",
hphandle, size, align);
BUG_ON(hphandle == NULL); BUG_ON(hphandle == NULL);
obj = (struct heap_object *)hphandle; obj = (struct heap_object *)hphandle;
...@@ -55,9 +52,6 @@ int heap_free(void *hphandle, void *block, u32 size) ...@@ -55,9 +52,6 @@ int heap_free(void *hphandle, void *block, u32 size)
struct heap_object *obj = NULL; struct heap_object *obj = NULL;
s32 retval = 0; s32 retval = 0;
gt_3trace(heap_debugmask, GT_6CLASS, "heap_free:\n"
"hphandle: %x, block: %x, size: %x \n",
hphandle, block, size);
BUG_ON(hphandle == NULL); BUG_ON(hphandle == NULL);
obj = (struct heap_object *)hphandle; obj = (struct heap_object *)hphandle;
...@@ -76,8 +70,6 @@ int heap_get_stats(void *hphandle, struct memory_stats *stats) ...@@ -76,8 +70,6 @@ int heap_get_stats(void *hphandle, struct memory_stats *stats)
struct heap_object *obj = NULL; struct heap_object *obj = NULL;
s32 retval = 0; s32 retval = 0;
gt_2trace(heap_debugmask, GT_6CLASS, "heap_get_stats:\n"
"hphandle: %x, stats: %x \n", hphandle, stats);
BUG_ON(hphandle == NULL); BUG_ON(hphandle == NULL);
BUG_ON(stats == NULL); BUG_ON(stats == NULL);
...@@ -98,9 +90,6 @@ int heap_get_extended_stats(void *hphandle, ...@@ -98,9 +90,6 @@ int heap_get_extended_stats(void *hphandle,
struct heap_object *obj = NULL; struct heap_object *obj = NULL;
s32 retval = 0; s32 retval = 0;
gt_2trace(heap_debugmask, GT_6CLASS,
"heap_get_extended_stats:\n"
"hphandle: %x, stats: %x \n", hphandle, stats);
BUG_ON(hphandle == NULL); BUG_ON(hphandle == NULL);
BUG_ON(stats == NULL); BUG_ON(stats == NULL);
......
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
#include <linux/mutex.h> #include <linux/mutex.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <gt.h>
#include <atomic_linux.h> #include <atomic_linux.h>
#include <multiproc.h> #include <multiproc.h>
#include <nameserver.h> #include <nameserver.h>
......
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
#include <linux/slab.h> #include <linux/slab.h>
/* Syslink headers */ /* Syslink headers */
#include <gt.h>
#include <syslink/atomic_linux.h> #include <syslink/atomic_linux.h>
/* Module level headers */ /* Module level headers */
#include <multiproc.h> #include <multiproc.h>
...@@ -132,10 +131,6 @@ static struct messageq_transportshm_moduleobject messageq_transportshm_state = { ...@@ -132,10 +131,6 @@ static struct messageq_transportshm_moduleobject messageq_transportshm_state = {
.def_inst_params.priority = MESSAGEQ_NORMALPRI .def_inst_params.priority = MESSAGEQ_NORMALPRI
}; };
#if GT_TRACE
static struct GT_Mask mqtshm_debugmask = { NULL, NULL }; /* GT trace variable */
EXPORT_SYMBOL(mqtshm_debugmask);
#endif
/* ============================================================================= /* =============================================================================
* Forward declarations of internal functions * Forward declarations of internal functions
...@@ -164,10 +159,6 @@ static void _messageq_transportshm_notify_fxn(u16 proc_id, ...@@ -164,10 +159,6 @@ static void _messageq_transportshm_notify_fxn(u16 proc_id,
void messageq_transportshm_get_config( void messageq_transportshm_get_config(
struct messageq_transportshm_config *cfg) struct messageq_transportshm_config *cfg)
{ {
gt_1trace(mqtshm_debugmask, GT_ENTER,
"messageq_transportshm_getConfig", cfg);
BUG_ON(cfg == NULL);
if (WARN_ON(cfg == NULL)) if (WARN_ON(cfg == NULL))
goto exit; goto exit;
...@@ -180,10 +171,11 @@ void messageq_transportshm_get_config( ...@@ -180,10 +171,11 @@ void messageq_transportshm_get_config(
memcpy(cfg, &(messageq_transportshm_state.cfg), memcpy(cfg, &(messageq_transportshm_state.cfg),
sizeof(struct messageq_transportshm_config)); sizeof(struct messageq_transportshm_config));
} }
return;
exit: exit:
gt_0trace(mqtshm_debugmask, GT_LEAVE, printk(KERN_ERR "messageq_transportshm_get_config: Argument of type"
"messageq_transportshm_getConfig"); "(struct messageq_transportshm_config *) passed is null!\n");
} }
...@@ -210,9 +202,6 @@ int messageq_transportshm_setup(const struct messageq_transportshm_config *cfg) ...@@ -210,9 +202,6 @@ int messageq_transportshm_setup(const struct messageq_transportshm_config *cfg)
int status = MESSAGEQ_TRANSPORTSHM_SUCCESS; int status = MESSAGEQ_TRANSPORTSHM_SUCCESS;
struct messageq_transportshm_config tmpCfg; struct messageq_transportshm_config tmpCfg;
gt_1trace(mqtshm_debugmask, GT_ENTER,
"messageq_transportshm_setup", cfg);
/* This sets the refCount variable is not initialized, upper 16 bits is /* This sets the refCount variable is not initialized, upper 16 bits is
* written with module Id to ensure correctness of refCount variable. * written with module Id to ensure correctness of refCount variable.
*/ */
...@@ -233,16 +222,12 @@ int messageq_transportshm_setup(const struct messageq_transportshm_config *cfg) ...@@ -233,16 +222,12 @@ int messageq_transportshm_setup(const struct messageq_transportshm_config *cfg)
messageq_transportshm_state.gate_handle = \ messageq_transportshm_state.gate_handle = \
kmalloc(sizeof(struct mutex), GFP_KERNEL); kmalloc(sizeof(struct mutex), GFP_KERNEL);
mutex_init(messageq_transportshm_state.gate_handle); mutex_init(messageq_transportshm_state.gate_handle);
if (messageq_transportshm_state.gate_handle == NULL) { if (messageq_transportshm_state.gate_handle == NULL) {
/* @retval MESSAGEQTRANSPORTSHM_E_FAIL Failed to create /* @retval MESSAGEQTRANSPORTSHM_E_FAIL Failed to create
GateMutex! */ GateMutex! */
status = MESSAGEQ_TRANSPORTSHM_E_FAIL; status = MESSAGEQ_TRANSPORTSHM_E_FAIL;
gt_2trace(mqtshm_debugmask, printk(KERN_ERR "messageq_transportshm_setup: Failed to create "
GT_4CLASS, "mutex!\n");
"messageq_transportshm_setup",
status,
"Failed to create GateMutex!");
atomic_set(&messageq_transportshm_state.ref_count, atomic_set(&messageq_transportshm_state.ref_count,
MESSAGEQTRANSPORTSHM_MAKE_MAGICSTAMP(0)); MESSAGEQTRANSPORTSHM_MAKE_MAGICSTAMP(0));
goto exit; goto exit;
...@@ -251,11 +236,11 @@ int messageq_transportshm_setup(const struct messageq_transportshm_config *cfg) ...@@ -251,11 +236,11 @@ int messageq_transportshm_setup(const struct messageq_transportshm_config *cfg)
/* Copy the user provided values into the state object. */ /* Copy the user provided values into the state object. */
memcpy(&messageq_transportshm_state.cfg, cfg, memcpy(&messageq_transportshm_state.cfg, cfg,
sizeof(struct messageq_transportshm_config)); sizeof(struct messageq_transportshm_config));
return status;
exit: exit:
gt_1trace(mqtshm_debugmask, GT_LEAVE, printk(KERN_ERR "messageq_transportshm_setup failed: status = 0x%x",
"messageq_transportshm_setup", status); status);
/* @retval MESSAGEQTRANSPORTSHM_SUCCESS Operation successful */
return status; return status;
} }
...@@ -273,8 +258,6 @@ int messageq_transportshm_destroy(void) ...@@ -273,8 +258,6 @@ int messageq_transportshm_destroy(void)
{ {
int status = 0; int status = 0;
gt_0trace(mqtshm_debugmask, GT_ENTER, "messageq_transportshm_destroy");
if (WARN_ON(atomic_cmpmask_and_lt( if (WARN_ON(atomic_cmpmask_and_lt(
&(messageq_transportshm_state.ref_count), &(messageq_transportshm_state.ref_count),
MESSAGEQTRANSPORTSHM_MAKE_MAGICSTAMP(0), MESSAGEQTRANSPORTSHM_MAKE_MAGICSTAMP(0),
...@@ -293,8 +276,11 @@ int messageq_transportshm_destroy(void) ...@@ -293,8 +276,11 @@ int messageq_transportshm_destroy(void)
atomic_set(&messageq_transportshm_state.ref_count, atomic_set(&messageq_transportshm_state.ref_count,
MESSAGEQTRANSPORTSHM_MAKE_MAGICSTAMP(0)); MESSAGEQTRANSPORTSHM_MAKE_MAGICSTAMP(0));
} }
return 0;
exit: exit:
printk(KERN_ERR "messageq_transportshm_destroy failed: status = 0x%x\n",
status);
return status; return status;
} }
...@@ -309,26 +295,19 @@ void messageq_transportshm_params_init(void *mqtshm_handle, ...@@ -309,26 +295,19 @@ void messageq_transportshm_params_init(void *mqtshm_handle,
{ {
struct messageq_transportshm_object *object = NULL; struct messageq_transportshm_object *object = NULL;
gt_2trace(mqtshm_debugmask, GT_ENTER,
"messageq_transportshm_params_init", mqtshm_handle,
params);
if (WARN_ON(atomic_cmpmask_and_lt( if (WARN_ON(atomic_cmpmask_and_lt(
&(messageq_transportshm_state.ref_count), &(messageq_transportshm_state.ref_count),
MESSAGEQTRANSPORTSHM_MAKE_MAGICSTAMP(0), MESSAGEQTRANSPORTSHM_MAKE_MAGICSTAMP(0),
MESSAGEQTRANSPORTSHM_MAKE_MAGICSTAMP(1)) == true)) MESSAGEQTRANSPORTSHM_MAKE_MAGICSTAMP(1)) == true)) {
printk(KERN_ERR "messageq_transportshm_params_init: Module was "
" not initialized\n");
goto exit; goto exit;
}
BUG_ON(params == NULL);
if (WARN_ON(params == NULL)) { if (WARN_ON(params == NULL)) {
/* @retval None */ printk(KERN_ERR "messageq_transportshm_params_init: Argument of"
gt_2trace(mqtshm_debugmask, " type (struct messageq_transportshm_params *) "
GT_4CLASS, "is NULL!");
"messageq_transportshm_params_init",
MESSAGEQ_TRANSPORTSHM_E_INVALIDARG,
"Argument of type "
"(messageq_transportshm_params *) is "
"NULL!");
goto exit; goto exit;
} }
...@@ -344,9 +323,6 @@ void messageq_transportshm_params_init(void *mqtshm_handle, ...@@ -344,9 +323,6 @@ void messageq_transportshm_params_init(void *mqtshm_handle,
} }
exit: exit:
gt_0trace(mqtshm_debugmask, GT_LEAVE,
"messageq_transportshm_params_init");
/* @retval None */
return; return;
} }
...@@ -367,16 +343,14 @@ void *messageq_transportshm_create(u16 proc_id, ...@@ -367,16 +343,14 @@ void *messageq_transportshm_create(u16 proc_id,
listmp_sharedmemory_params listmp_params[2]; listmp_sharedmemory_params listmp_params[2];
VOLATILE u32 *otherflag; VOLATILE u32 *otherflag;
gt_2trace(mqtshm_debugmask, GT_ENTER, "messageq_transportshm_create",
proc_id, params);
if (WARN_ON(atomic_cmpmask_and_lt( if (WARN_ON(atomic_cmpmask_and_lt(
&(messageq_transportshm_state.ref_count), &(messageq_transportshm_state.ref_count),
MESSAGEQTRANSPORTSHM_MAKE_MAGICSTAMP(0), MESSAGEQTRANSPORTSHM_MAKE_MAGICSTAMP(0),
MESSAGEQTRANSPORTSHM_MAKE_MAGICSTAMP(1)) == true)) MESSAGEQTRANSPORTSHM_MAKE_MAGICSTAMP(1)) == true)) {
status = -ENODEV;
goto exit; goto exit;
}
BUG_ON(params == NULL);
if (WARN_ON(params == NULL)) { if (WARN_ON(params == NULL)) {
status = -EINVAL; status = -EINVAL;
goto exit; goto exit;
...@@ -422,11 +396,8 @@ void *messageq_transportshm_create(u16 proc_id, ...@@ -422,11 +396,8 @@ void *messageq_transportshm_create(u16 proc_id,
(void *)handle); (void *)handle);
if (status < 0) { if (status < 0) {
/* @retval NULL Notify register failed */ /* @retval NULL Notify register failed */
gt_2trace(mqtshm_debugmask, printk(KERN_ERR "messageq_transportshm_create: "
GT_4CLASS, "notify_register_event failed!\n");
"messageq_transportshm_create",
MESSAGEQ_TRANSPORTSHM_E_FAIL,
"Notify register failed!");
goto notify_register_fail; goto notify_register_fail;
} }
...@@ -464,8 +435,6 @@ void *messageq_transportshm_create(u16 proc_id, ...@@ -464,8 +435,6 @@ void *messageq_transportshm_create(u16 proc_id,
/* Store in VOLATILE to make sure it is not compiled out... */ /* Store in VOLATILE to make sure it is not compiled out... */
otherflag = &(handle->attrs[remote_index]->flag); otherflag = &(handle->attrs[remote_index]->flag);
gt_1trace(mqtshm_debugmask, GT_1CLASS, "messageq_transportshm_create\n"
"Synchronization flag addr [0x%x]", otherflag);
/* Loop until the other side is up */ /* Loop until the other side is up */
while (*otherflag != MESSAGEQ_TRANSPORTSHM_UP) while (*otherflag != MESSAGEQ_TRANSPORTSHM_UP)
...@@ -474,10 +443,8 @@ void *messageq_transportshm_create(u16 proc_id, ...@@ -474,10 +443,8 @@ void *messageq_transportshm_create(u16 proc_id,
if (handle->attrs[remote_index]->version if (handle->attrs[remote_index]->version
!= MESSAGEQ_TRANSPORTSHM_VERSION) { != MESSAGEQ_TRANSPORTSHM_VERSION) {
/* @retval NULL Versions do not match */ /* @retval NULL Versions do not match */
gt_2trace(mqtshm_debugmask, GT_4CLASS, printk(KERN_ERR "messageq_transportshm_create: "
"messageq_transportshm_create", "Incorrect version of remote transport!\n");
MESSAGEQ_TRANSPORTSHM_E_BADVERSION,
"Incorrect version of remote transport!");
goto exit; goto exit;
} }
...@@ -486,11 +453,6 @@ void *messageq_transportshm_create(u16 proc_id, ...@@ -486,11 +453,6 @@ void *messageq_transportshm_create(u16 proc_id,
&listmp_params[remote_index]); &listmp_params[remote_index]);
if (status < 0) { if (status < 0) {
/* @retval NULL List creation failed */ /* @retval NULL List creation failed */
gt_2trace(mqtshm_debugmask,
GT_4CLASS,
"messageq_transportshm_create",
status,
"List creation failed!");
goto listmp_open_fail; goto listmp_open_fail;
} }
...@@ -499,8 +461,11 @@ void *messageq_transportshm_create(u16 proc_id, ...@@ -499,8 +461,11 @@ void *messageq_transportshm_create(u16 proc_id,
(u32)params->priority); (u32)params->priority);
if (status >= 0) if (status >= 0)
handle->status = messageq_transportshm_status_UP; handle->status = messageq_transportshm_status_UP;
return handle;
listmp_open_fail: listmp_open_fail:
printk(KERN_ERR "messageq_transportshm_create: "
"listmp_sharedmemory_open failed!\n");
notify_register_fail: notify_register_fail:
if (status < 0) { if (status < 0) {
if (handle != NULL) { if (handle != NULL) {
...@@ -510,10 +475,8 @@ notify_register_fail: ...@@ -510,10 +475,8 @@ notify_register_fail:
} }
exit: exit:
gt_1trace(mqtshm_debugmask, GT_LEAVE, "messageq_transportshm_create", printk(KERN_ERR "messageq_transportshm_create failed: status = 0x%x\n",
handle); status);
/* @retval Valid handle of type messageq_transportshm_handle
Operation successful */
return handle; return handle;
} }
...@@ -528,9 +491,6 @@ int messageq_transportshm_delete(void **mqtshm_handleptr) ...@@ -528,9 +491,6 @@ int messageq_transportshm_delete(void **mqtshm_handleptr)
int tmpstatus = 0; int tmpstatus = 0;
struct messageq_transportshm_object *obj; struct messageq_transportshm_object *obj;
gt_1trace(mqtshm_debugmask, GT_ENTER, "messageq_transportshm_delete",
mqtshm_handleptr);
if (WARN_ON(atomic_cmpmask_and_lt( if (WARN_ON(atomic_cmpmask_and_lt(
&(messageq_transportshm_state.ref_count), &(messageq_transportshm_state.ref_count),
MESSAGEQTRANSPORTSHM_MAKE_MAGICSTAMP(0), MESSAGEQTRANSPORTSHM_MAKE_MAGICSTAMP(0),
...@@ -539,7 +499,6 @@ int messageq_transportshm_delete(void **mqtshm_handleptr) ...@@ -539,7 +499,6 @@ int messageq_transportshm_delete(void **mqtshm_handleptr)
goto exit; goto exit;
} }
BUG_ON(mqtshm_handleptr == NULL);
if (WARN_ON(mqtshm_handleptr == NULL)) { if (WARN_ON(mqtshm_handleptr == NULL)) {
status = -EINVAL; status = -EINVAL;
goto exit; goto exit;
...@@ -548,11 +507,8 @@ int messageq_transportshm_delete(void **mqtshm_handleptr) ...@@ -548,11 +507,8 @@ int messageq_transportshm_delete(void **mqtshm_handleptr)
/* @retval MESSAGEQTRANSPORTSHM_E_HANDLE Invalid NULL handle /* @retval MESSAGEQTRANSPORTSHM_E_HANDLE Invalid NULL handle
specified */ specified */
status = MESSAGEQ_TRANSPORTSHM_E_HANDLE; status = MESSAGEQ_TRANSPORTSHM_E_HANDLE;
gt_2trace(mqtshm_debugmask, printk(KERN_WARNING "messageq_transportshm_delete: Invalid NULL"
GT_4CLASS, " mqtshm_handle specified! status = 0x%x\n", status);
"messageq_transportshm_delete",
MESSAGEQ_TRANSPORTSHM_E_HANDLE,
"Invalid NULL mqtshm_handle specified");
goto exit; goto exit;
} }
...@@ -561,28 +517,24 @@ int messageq_transportshm_delete(void **mqtshm_handleptr) ...@@ -561,28 +517,24 @@ int messageq_transportshm_delete(void **mqtshm_handleptr)
status = listmp_sharedmemory_delete( status = listmp_sharedmemory_delete(
(listmp_sharedmemory_handle *)&obj->my_listmp_handle); (listmp_sharedmemory_handle *)&obj->my_listmp_handle);
if (status < 0) { if (status < 0) {
gt_2trace(mqtshm_debugmask, GT_4CLASS, printk(KERN_WARNING "messageq_transportshm_delete: Failed to "
"MessageQTransportShm_delete", status, "delete listmp_sharedmemory instance!\n");
"Failed to delete ListMPSharedMemory"
" instance!");
} }
tmpstatus = listmp_sharedmemory_close( tmpstatus = listmp_sharedmemory_close(
(listmp_sharedmemory_handle) obj->remote_listmp_handle); (listmp_sharedmemory_handle) obj->remote_listmp_handle);
if ((tmpstatus < 0) && (status >= 0)) { if ((tmpstatus < 0) && (status >= 0)) {
status = tmpstatus; status = tmpstatus;
gt_2trace(mqtshm_debugmask, GT_4CLASS, printk(KERN_WARNING "messageq_transportshm_delete: Failed to "
"MessageQTransportShm_delete", "close listmp_sharedmemory instance!\n");
status, "Failed to close ListMPSharedMemory instance!");
} }
tmpstatus = messageq_unregister_transport(obj->proc_id, tmpstatus = messageq_unregister_transport(obj->proc_id,
obj->params.priority); obj->params.priority);
if ((tmpstatus < 0) && (status >= 0)) { if ((tmpstatus < 0) && (status >= 0)) {
status = tmpstatus; status = tmpstatus;
gt_2trace(mqtshm_debugmask, GT_4CLASS, printk(KERN_WARNING "messageq_transportshm_delete: Failed to "
"MessageQTransportShm_delete", status, "unregister transport!\n");
"Failed to unregister transport");
} }
tmpstatus = notify_unregister_event(obj->notify_driver, obj->proc_id, tmpstatus = notify_unregister_event(obj->notify_driver, obj->proc_id,
...@@ -591,16 +543,17 @@ int messageq_transportshm_delete(void **mqtshm_handleptr) ...@@ -591,16 +543,17 @@ int messageq_transportshm_delete(void **mqtshm_handleptr)
(void *)obj); (void *)obj);
if ((tmpstatus < 0) && (status >= 0)) { if ((tmpstatus < 0) && (status >= 0)) {
status = tmpstatus; status = tmpstatus;
gt_2trace(mqtshm_debugmask, GT_4CLASS, printk(KERN_WARNING "messageq_transportshm_delete: Failed to "
"MessageQTransportShm_delete", "unregister notify event!\n");
status, "Failed to unregister Notify event");
} }
kfree(obj); kfree(obj);
*mqtshm_handleptr = NULL; *mqtshm_handleptr = NULL;
exit: exit:
gt_0trace(mqtshm_debugmask, GT_LEAVE, "messageq_transportshm_delete"); if (status < 0)
printk(KERN_ERR "messageq_transportshm_delete failed: "
"status = 0x%x\n", status);
return status; return status;
} }
...@@ -616,8 +569,6 @@ int messageq_transportshm_put(void *mqtshm_handle, ...@@ -616,8 +569,6 @@ int messageq_transportshm_put(void *mqtshm_handle,
struct messageq_transportshm_object *obj = \ struct messageq_transportshm_object *obj = \
(struct messageq_transportshm_object *) mqtshm_handle; (struct messageq_transportshm_object *) mqtshm_handle;
gt_2trace(mqtshm_debugmask, GT_ENTER, "messageq_transportshm_put",
obj, msg);
if (WARN_ON(atomic_cmpmask_and_lt( if (WARN_ON(atomic_cmpmask_and_lt(
&(messageq_transportshm_state.ref_count), &(messageq_transportshm_state.ref_count),
MESSAGEQTRANSPORTSHM_MAKE_MAGICSTAMP(0), MESSAGEQTRANSPORTSHM_MAKE_MAGICSTAMP(0),
...@@ -627,8 +578,6 @@ int messageq_transportshm_put(void *mqtshm_handle, ...@@ -627,8 +578,6 @@ int messageq_transportshm_put(void *mqtshm_handle,
} }
BUG_ON(mqtshm_handle == NULL); BUG_ON(mqtshm_handle == NULL);
BUG_ON(msg == NULL);
if (WARN_ON(msg == NULL)) { if (WARN_ON(msg == NULL)) {
status = -EINVAL; status = -EINVAL;
goto exit; goto exit;
...@@ -645,11 +594,8 @@ int messageq_transportshm_put(void *mqtshm_handle, ...@@ -645,11 +594,8 @@ int messageq_transportshm_put(void *mqtshm_handle,
* Notification to remote processor failed! * Notification to remote processor failed!
*/ */
status = MESSAGEQ_TRANSPORTSHM_E_FAIL; status = MESSAGEQ_TRANSPORTSHM_E_FAIL;
gt_2trace(mqtshm_debugmask, printk(KERN_ERR "messageq_transportshm_put: Failed to put "
GT_4CLASS, "message in the shared list! status = 0x%x\n", status);
"messageq_transportshm_put",
status,
"Failed to put message in the shared list!");
goto exit; goto exit;
} }
...@@ -661,15 +607,16 @@ int messageq_transportshm_put(void *mqtshm_handle, ...@@ -661,15 +607,16 @@ int messageq_transportshm_put(void *mqtshm_handle,
goto exit; goto exit;
notify_send_fail: notify_send_fail:
gt_2trace(mqtshm_debugmask, GT_4CLASS, "messageq_transportshm_put", printk(KERN_ERR "messageq_transportshm_put: Notification to remote "
status, "Notification to remote processor failed!"); "processor failed, status = 0x%x\n", status);
/* If sending the event failed, then remove the element from the list.*/ /* If sending the event failed, then remove the element from the list.*/
/* Ignore the status of remove. */ /* Ignore the status of remove. */
listmp_remove(obj->remote_listmp_handle, (struct listmp_elem *) msg); listmp_remove(obj->remote_listmp_handle, (struct listmp_elem *) msg);
exit: exit:
gt_1trace(mqtshm_debugmask, GT_LEAVE, "messageq_transportshm_put", if (status < 0)
status); printk(KERN_ERR "messageq_transportshm_put failed: "
"status = 0x%x\n", status);
return status; return status;
} }
...@@ -680,13 +627,9 @@ exit: ...@@ -680,13 +627,9 @@ exit:
*/ */
int messageq_transportshm_control(void *mqtshm_handle, u32 cmd, u32 *cmdArg) int messageq_transportshm_control(void *mqtshm_handle, u32 cmd, u32 *cmdArg)
{ {
gt_3trace(mqtshm_debugmask, GT_ENTER, "messageq_transportshm_control",
mqtshm_handle, cmd, cmdArg);
BUG_ON(mqtshm_handle == NULL); BUG_ON(mqtshm_handle == NULL);
gt_1trace(mqtshm_debugmask, GT_LEAVE, "messageq_transportshm_control", printk(KERN_ALERT "messageq_transportshm_control not supported!\n");
MESSAGEQTRANSPORTSHM_E_NOTSUPPORTED);
return MESSAGEQTRANSPORTSHM_E_NOTSUPPORTED; return MESSAGEQTRANSPORTSHM_E_NOTSUPPORTED;
} }
...@@ -701,13 +644,8 @@ enum messageq_transportshm_status messageq_transportshm_get_status( ...@@ -701,13 +644,8 @@ enum messageq_transportshm_status messageq_transportshm_get_status(
struct messageq_transportshm_object *obj = \ struct messageq_transportshm_object *obj = \
(struct messageq_transportshm_object *) mqtshm_handle; (struct messageq_transportshm_object *) mqtshm_handle;
gt_1trace(mqtshm_debugmask, GT_ENTER,
"messageq_transportshm_getStatus", obj);
BUG_ON(obj == NULL); BUG_ON(obj == NULL);
gt_1trace(mqtshm_debugmask, GT_LEAVE, "messageq_transportshm_getStatus",
obj->status);
return obj->status; return obj->status;
} }
...@@ -723,9 +661,6 @@ u32 messageq_transportshm_shared_mem_req(const ...@@ -723,9 +661,6 @@ u32 messageq_transportshm_shared_mem_req(const
listmp_sharedmemory_params listmp_params; listmp_sharedmemory_params listmp_params;
u32 listmp_size; u32 listmp_size;
gt_1trace(mqtshm_debugmask, GT_ENTER,
"messageq_transportshm_sharedMemReq", params);
/* There are two transport flags in shared memory */ /* There are two transport flags in shared memory */
totalSize = 2 * MESSAGEQ_TRANSPORTSHM_CACHESIZE; totalSize = 2 * MESSAGEQ_TRANSPORTSHM_CACHESIZE;
...@@ -738,8 +673,6 @@ u32 messageq_transportshm_shared_mem_req(const ...@@ -738,8 +673,6 @@ u32 messageq_transportshm_shared_mem_req(const
/* RemoteList */ /* RemoteList */
totalSize += listmp_size; totalSize += listmp_size;
gt_1trace(mqtshm_debugmask, GT_LEAVE,
"messageq_transportshm_sharedMemReq", totalSize);
return totalSize; return totalSize;
} }
...@@ -760,11 +693,6 @@ void _messageq_transportshm_notify_fxn(u16 proc_id, u32 event_no, ...@@ -760,11 +693,6 @@ void _messageq_transportshm_notify_fxn(u16 proc_id, u32 event_no,
messageq_msg msg = NULL; messageq_msg msg = NULL;
u32 queue_id; u32 queue_id;
gt_4trace(mqtshm_debugmask, GT_ENTER,
"_messageq_transportshm_notify_fxn",
proc_id, event_no, arg, payload);
BUG_ON(arg == NULL);
if (WARN_ON(arg == NULL)) if (WARN_ON(arg == NULL))
goto exit; goto exit;
...@@ -777,10 +705,11 @@ void _messageq_transportshm_notify_fxn(u16 proc_id, u32 event_no, ...@@ -777,10 +705,11 @@ void _messageq_transportshm_notify_fxn(u16 proc_id, u32 event_no,
queue_id = messageq_get_dst_queue(msg); queue_id = messageq_get_dst_queue(msg);
messageq_put(queue_id, msg); messageq_put(queue_id, msg);
} }
return;
exit: exit:
gt_0trace(mqtshm_debugmask, GT_LEAVE, printk(KERN_ERR "messageq_transportshm_notify_fxn: argument passed is "
"messageq_transportshm_notifyFxn"); "NULL!\n");
} }
...@@ -798,12 +727,12 @@ void messageq_transportshm_set_err_fxn( ...@@ -798,12 +727,12 @@ void messageq_transportshm_set_err_fxn(
{ {
u32 key; u32 key;
key = mutex_lock_interruptible(messageq_transportshm_state.gate_handle); key = mutex_lock_interruptible(messageq_transportshm_state.gate_handle);
if (key < 0) if (key < 0)
goto exit; goto exit;
messageq_transportshm_state.cfg.err_fxn = err_fxn; messageq_transportshm_state.cfg.err_fxn = err_fxn;
mutex_unlock(messageq_transportshm_state.gate_handle); mutex_unlock(messageq_transportshm_state.gate_handle);
exit: exit:
return; return;
......
...@@ -24,9 +24,6 @@ ...@@ -24,9 +24,6 @@
#include <linux/bug.h> #include <linux/bug.h>
#include <linux/fs.h> #include <linux/fs.h>
/* Syslink headers */
#include <gt.h>
/* Module Headers */ /* Module Headers */
#include <messageq.h> #include <messageq.h>
#include <messageq_transportshm.h> #include <messageq_transportshm.h>
...@@ -255,10 +252,6 @@ int messageq_transportshm_ioctl(struct inode *inode, struct file *filp, ...@@ -255,10 +252,6 @@ int messageq_transportshm_ioctl(struct inode *inode, struct file *filp,
struct messageq_transportshm_cmd_args cargs; struct messageq_transportshm_cmd_args cargs;
unsigned long size; unsigned long size;
gt_4trace(curTrace, GT_ENTER, "messageq_transportshm_ioctl"
"inode: %x, filp: %x,\n cmd: %x, args: %x",
inode, filp, cmd, args);
if (_IOC_DIR(cmd) & _IOC_READ) if (_IOC_DIR(cmd) & _IOC_READ)
os_status = !access_ok(VERIFY_WRITE, uarg, _IOC_SIZE(cmd)); os_status = !access_ok(VERIFY_WRITE, uarg, _IOC_SIZE(cmd));
else if (_IOC_DIR(cmd) & _IOC_WRITE) else if (_IOC_DIR(cmd) & _IOC_WRITE)
...@@ -328,8 +321,10 @@ int messageq_transportshm_ioctl(struct inode *inode, struct file *filp, ...@@ -328,8 +321,10 @@ int messageq_transportshm_ioctl(struct inode *inode, struct file *filp,
os_status = -EFAULT; os_status = -EFAULT;
goto exit; goto exit;
} }
return os_status;
exit: exit:
gt_1trace(curTrace, GT_LEAVE, "messageq_transportshm_ioctl", os_status); printk(KERN_ERR "messageq_transportshm_ioctl failed: status = 0x%x\n",
os_status);
return os_status; return os_status;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment