Commit 959992b4 authored by Suman Anna's avatar Suman Anna Committed by Hari Kanigeri

SYSLINK: ipc - removed gt_traces from listmp modules

This patch cleaned up all the gt_traces in listmp_sharedmemory and listmp
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 43b340cf
......@@ -63,27 +63,18 @@
#include <linux/string.h>
#include <linux/list.h>
/* Syslink headers */
#include <gt.h>
/* Module level headers */
#include <nameserver.h>
#include <listmp.h>
#include <listmp_sharedmemory.h>
#if GT_TRACE
static struct GT_Mask listmp_debugmask = { NULL, NULL }; /* GT trace variable */
EXPORT_SYMBOL(listmp_debugmask);
#endif
/*
* ======== listmp_params_init ========
* Purpose:
* Function initializes listmp parameters
*/
void listmp_params_init(void *listmp_handle,
struct listmp_params *params)
void listmp_params_init(void *listmp_handle, struct listmp_params *params)
{
BUG_ON(params == NULL);
listmp_sharedmemory_params_init(listmp_handle, params);
......@@ -115,20 +106,17 @@ void *listmp_create(struct listmp_params *params)
{
struct listmp_object *handle = NULL;
gt_1trace(listmp_debugmask, GT_ENTER, "listmp_create", params);
BUG_ON(params == NULL);
if (WARN_ON(params == NULL))
goto exit;
if (params->list_type == listmp_type_SHARED)
handle = (struct listmp_object *)
listmp_sharedmemory_create(params);
return (void *)handle;
exit:
gt_1trace(listmp_debugmask, GT_LEAVE, "listmp_create", handle);
return (void *)handle;
printk(KERN_ERR "listmp_create: listmp_params passed are NULL!\n");
return NULL;
}
/*
......@@ -140,10 +128,6 @@ int listmp_delete(void **listmp_handle_ptr)
{
int status = 0;
gt_1trace(listmp_debugmask, GT_ENTER, "listmp_delete",
listmp_handle_ptr);
BUG_ON(*listmp_handle_ptr == NULL);
if (WARN_ON(*listmp_handle_ptr == NULL)) {
status = -EINVAL;
goto exit;
......@@ -154,7 +138,10 @@ int listmp_delete(void **listmp_handle_ptr)
status = listmp_sharedmemory_delete(listmp_handle_ptr);
exit:
gt_1trace(listmp_debugmask, GT_LEAVE, "listmp_delete", status);
if (status < 0) {
printk(KERN_ERR "listmp_delete failed! status = 0x%x\n",
status);
}
return status;
}
......@@ -167,11 +154,6 @@ int listmp_open(void **listmp_handle_ptr, struct listmp_params *params)
{
int status = 0;
gt_2trace(listmp_debugmask, GT_ENTER, "listmp_open", listmp_handle_ptr,
params);
BUG_ON(listmp_handle_ptr == NULL);
BUG_ON(params == NULL);
if (WARN_ON(listmp_handle_ptr == NULL)) {
status = -EINVAL;
goto exit;
......@@ -185,7 +167,8 @@ int listmp_open(void **listmp_handle_ptr, struct listmp_params *params)
status = listmp_sharedmemory_open(listmp_handle_ptr, params);
exit:
gt_1trace(listmp_debugmask, GT_LEAVE, "listmp_open", status);
if (status < 0)
printk(KERN_ERR "listmp_open failed! status = 0x%x\n", status);
return status;
}
......@@ -198,9 +181,6 @@ int listmp_close(void *listmp_handle)
{
int status = 0;
gt_1trace(listmp_debugmask, GT_ENTER, "listmp_close", listmp_handle);
BUG_ON(listmp_handle == NULL);
if (WARN_ON(listmp_handle == NULL)) {
status = -EINVAL;
goto exit;
......@@ -211,7 +191,8 @@ int listmp_close(void *listmp_handle)
status = listmp_sharedmemory_close(listmp_handle);
exit:
gt_1trace(listmp_debugmask, GT_LEAVE, "listmp_close", status);
if (status < 0)
printk(KERN_ERR "listmp_close failed! status = 0x%x\n", status);
return status;
}
......@@ -225,9 +206,6 @@ bool listmp_empty(void *listmp_handle)
bool isEmpty = false;
struct listmp_object *handle = NULL;
gt_1trace(listmp_debugmask, GT_ENTER, "listmp_empty", listmp_handle);
BUG_ON(listmp_handle == NULL);
if (WARN_ON(listmp_handle == NULL))
goto exit;
......@@ -237,7 +215,6 @@ bool listmp_empty(void *listmp_handle)
isEmpty = handle->empty(listmp_handle);
exit:
gt_1trace(listmp_debugmask, GT_LEAVE, "listmp_empty", isEmpty);
return isEmpty;
}
......@@ -251,9 +228,6 @@ void *listmp_get_head(void *listmp_handle)
struct listmp_object *handle = NULL;
struct listmp_elem *elem = NULL;
gt_1trace(listmp_debugmask, GT_ENTER, "listmp_get_head", listmp_handle);
BUG_ON(listmp_handle == NULL);
if (WARN_ON(listmp_handle == NULL))
goto exit;
......@@ -263,7 +237,6 @@ void *listmp_get_head(void *listmp_handle)
elem = handle->get_head(listmp_handle);
exit:
gt_1trace(listmp_debugmask, GT_LEAVE, "listmp_get_head", elem);
return elem;
}
......@@ -277,9 +250,6 @@ void *listmp_get_tail(void *listmp_handle)
struct listmp_object *handle = NULL;
struct listmp_elem *elem = NULL;
gt_1trace(listmp_debugmask, GT_ENTER, "listmp_get_tail", listmp_handle);
BUG_ON(listmp_handle == NULL);
if (WARN_ON(listmp_handle == NULL))
goto exit;
......@@ -289,7 +259,6 @@ void *listmp_get_tail(void *listmp_handle)
elem = handle->get_tail(listmp_handle);
exit:
gt_1trace(listmp_debugmask, GT_LEAVE, "listmp_get_tail", elem);
return elem;
}
......@@ -303,11 +272,6 @@ int listmp_put_head(void *listmp_handle, struct listmp_elem *elem)
int status = 0;
struct listmp_object *handle = NULL;
gt_2trace(listmp_debugmask, GT_ENTER, "listmp_put_head",
listmp_handle,
elem);
BUG_ON(listmp_handle == NULL);
if (WARN_ON(listmp_handle == NULL)) {
status = -EINVAL;
goto exit;
......@@ -323,7 +287,10 @@ int listmp_put_head(void *listmp_handle, struct listmp_elem *elem)
status = handle->put_head(listmp_handle, elem);
exit:
gt_1trace(listmp_debugmask, GT_LEAVE, "listmp_put_head", status);
if (status < 0) {
printk(KERN_ERR "listmp_put_head failed! status = 0x%x\n",
status);
}
return status;
}
......@@ -337,10 +304,6 @@ int listmp_put_tail(void *listmp_handle, struct listmp_elem *elem)
int status = 0;
struct listmp_object *handle = NULL;
gt_2trace(listmp_debugmask, GT_ENTER, "listmp_put_tail", listmp_handle,
elem);
BUG_ON(listmp_handle == NULL);
if (WARN_ON(listmp_handle == NULL)) {
status = -EINVAL;
goto exit;
......@@ -356,7 +319,10 @@ int listmp_put_tail(void *listmp_handle, struct listmp_elem *elem)
status = handle->put_tail(listmp_handle, elem);
exit:
gt_1trace(listmp_debugmask, GT_LEAVE, "listmp_put_tail", status);
if (status < 0) {
printk(KERN_ERR "listmp_put_tail failed! status = 0x%x\n",
status);
}
return status;
}
......@@ -371,12 +337,6 @@ int listmp_insert(void *listmp_handle, struct listmp_elem *elem,
int status = 0;
struct listmp_object *handle = NULL;
gt_3trace(listmp_debugmask, GT_ENTER, "listmp_insert",
listmp_handle,
elem,
curElem);
BUG_ON(listmp_handle == NULL);
if (WARN_ON(listmp_handle == NULL)) {
status = -EINVAL;
goto exit;
......@@ -396,7 +356,10 @@ int listmp_insert(void *listmp_handle, struct listmp_elem *elem,
status = handle->insert(listmp_handle, elem, curElem);
exit:
gt_1trace(listmp_debugmask, GT_LEAVE, "listmp_insert", status);
if (status < 0) {
printk(KERN_ERR "listmp_insert failed! status = 0x%x\n",
status);
}
return status;
}
......@@ -410,10 +373,6 @@ int listmp_remove(void *listmp_handle, struct listmp_elem *elem)
int status = LISTMP_SUCCESS;
struct listmp_object *handle = NULL;
gt_2trace(listmp_debugmask, GT_ENTER, "listmp_remove", listmp_handle,
elem);
BUG_ON(listmp_handle == NULL);
if (WARN_ON(listmp_handle == NULL)) {
status = -EINVAL;
goto exit;
......@@ -429,7 +388,10 @@ int listmp_remove(void *listmp_handle, struct listmp_elem *elem)
status = handle->remove(listmp_handle, elem);
exit:
gt_1trace(listmp_debugmask, GT_LEAVE, "listmp_remove", status);
if (status < 0) {
printk(KERN_ERR "listmp_remove failed! status = 0x%x\n",
status);
}
return status ;
}
......@@ -443,9 +405,6 @@ void *listmp_next(void *listmp_handle, struct listmp_elem *elem)
struct listmp_object *handle = NULL;
struct listmp_elem *nextElem = NULL;
gt_1trace(listmp_debugmask, GT_ENTER, "listmp_next", listmp_handle);
BUG_ON(listmp_handle == NULL);
if (WARN_ON(listmp_handle == NULL))
goto exit;
......@@ -455,7 +414,6 @@ void *listmp_next(void *listmp_handle, struct listmp_elem *elem)
nextElem = handle->next(listmp_handle, elem);
exit:
gt_1trace(listmp_debugmask, GT_LEAVE, "listmp_next", nextElem);
return nextElem;
}
......@@ -469,9 +427,6 @@ void *listmp_prev(void *listmp_handle, struct listmp_elem *elem)
struct listmp_object *handle = NULL;
struct listmp_elem *prevElem = NULL;
gt_1trace(listmp_debugmask, GT_ENTER, "listmp_prev", listmp_handle);
BUG_ON(listmp_handle == NULL);
if (WARN_ON(listmp_handle == NULL))
goto exit;
......@@ -481,7 +436,5 @@ void *listmp_prev(void *listmp_handle, struct listmp_elem *elem)
prevElem = handle->prev(listmp_handle, elem);
exit:
gt_1trace(listmp_debugmask, GT_LEAVE, "listmp_prev", prevElem);
return prevElem;
}
......@@ -66,8 +66,8 @@
#include <linux/string.h>
/* Syslink headers */
#include <gt.h>
#include <syslink/atomic_linux.h>
/* Module level headers */
#include <nameserver.h>
#include <sharedregion.h>
......@@ -97,8 +97,6 @@
#define LISTMP_SHAREDMEMORY_CACHESIZE 128
#define VOLATILE volatile
/* =============================================================================
* Structures and Enums
......@@ -158,11 +156,6 @@ struct listmp_sharedmemory_obj{
/*!< Pointer to the top Object */
};
#if GT_TRACE
/* GT trace variable */
static struct GT_Mask listmpshm_debugmask = { NULL, NULL };
EXPORT_SYMBOL(listmpshm_debugmask);
#endif
/* =============================================================================
* Function definitions
......@@ -194,10 +187,6 @@ int listmp_sharedmemory_get_config(struct listmp_config *cfgParams)
{
int status = 0;
gt_1trace(listmpshm_debugmask, GT_ENTER,
"listmp_sharedmemory_get_config", cfgParams);
BUG_ON(cfgParams == NULL);
if (WARN_ON(cfgParams == NULL)) {
status = -EINVAL;
goto exit;
......@@ -212,10 +201,11 @@ int listmp_sharedmemory_get_config(struct listmp_config *cfgParams)
else
memcpy(cfgParams, &listmp_sharedmemory_state.cfg,
sizeof(struct listmp_config));
return 0;
exit:
gt_1trace(listmpshm_debugmask, GT_LEAVE,
"listmp_sharedmemory_get_config", status);
printk(KERN_ERR "listmp_sharedmemory_get_config failed: "
"status = 0x%x\n", status);
return status;
}
......@@ -232,8 +222,6 @@ int listmp_sharedmemory_setup(struct listmp_config *config)
struct nameserver_params params;
struct listmp_config tmp_cfg;
gt_1trace(listmpshm_debugmask, GT_ENTER, "ListMPSharedmemsetup",
config);
/* This sets the refCount variable is not initialized, upper 16 bits is
* written with module Id to ensure correctness of refCount variable.
*/
......@@ -277,11 +265,6 @@ int listmp_sharedmemory_setup(struct listmp_config *config)
listmp_sharedmemory_state.local_gate = \
kmalloc(sizeof(struct mutex), GFP_KERNEL);
if (listmp_sharedmemory_state.local_gate == NULL) {
gt_2trace(listmpshm_debugmask,
GT_4CLASS,
"ListMPSharedmemsetup",
LISTMPSHAREDMEMORY_E_FAIL,
"Failed to create the local_gate!");
status = -ENOMEM;
goto clean_nameserver;
}
......@@ -290,9 +273,11 @@ int listmp_sharedmemory_setup(struct listmp_config *config)
/* Copy the cfg */
memcpy(&listmp_sharedmemory_state.cfg, config,
sizeof(struct listmp_config));
goto exit;
return 0;
clean_nameserver:
printk(KERN_ERR "listmp_sharedmemory_setup: Failed to create the local "
"gate! status = 0x%x\n", status);
atomic_set(&listmp_sharedmemory_state.ref_count,
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(0));
status1 = nameserver_delete
......@@ -300,7 +285,7 @@ clean_nameserver:
BUG_ON(status1 < 0);
exit:
gt_1trace(listmpshm_debugmask, GT_LEAVE, "ListMPSharedmemsetup",
printk(KERN_ERR "listmp_sharedmemory_setup failed! status = 0x%x\n",
status);
return status;
}
......@@ -318,8 +303,6 @@ int listmp_sharedmemory_destroy(void)
struct list_head *head = &listmp_sharedmemory_state.obj_list;
struct list_head *next;
gt_0trace(listmpshm_debugmask, GT_ENTER, "listmp_sharedmemory_destroy");
if (atomic_cmpmask_and_lt(&(listmp_sharedmemory_state.ref_count),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(0),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(1)) == true) {
......@@ -376,37 +359,38 @@ int listmp_sharedmemory_destroy(void)
atomic_set(&listmp_sharedmemory_state.ref_count,
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(0));
}
exit:
gt_1trace(listmpshm_debugmask, GT_LEAVE, "listmp_sharedmemory_destroy",
status);
if (status < 0) {
printk(KERN_ERR "listmp_sharedmemory_destroy failed! "
"status = 0x%x\n", status);
}
return status;
}
/*!
* @brief Initialize this config-params structure with supplier-specified
/*
* ======== listmp_sharedmemory_params_init ========
* Purpose:
* Function to initialize the config-params structure with supplier-specified
* defaults before instance creation.
*
* @param handle Instance specific handle.
* @param params Instance creation structure.
*
* @sa listmp_sharedmemory_create
*/
void listmp_sharedmemory_params_init(listmp_sharedmemory_handle handle,
listmp_sharedmemory_params *params)
{
s32 status = 0;
struct listmp_sharedmemory_obj *obj = NULL;
gt_2trace(listmpshm_debugmask, GT_ENTER,
"listmp_sharedmemory_params_init", handle, params);
if (atomic_cmpmask_and_lt(&(listmp_sharedmemory_state.ref_count),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(0),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(1)) == true)
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(1)) == true) {
status = -ENODEV;
goto exit;
}
BUG_ON(params == NULL);
if (WARN_ON(params == NULL))
if (WARN_ON(params == NULL)) {
status = -EINVAL;
goto exit;
}
if (handle == NULL) {
memcpy(params,
......@@ -420,10 +404,11 @@ void listmp_sharedmemory_params_init(listmp_sharedmemory_handle handle,
(void *)params,
sizeof(listmp_sharedmemory_params));
}
return;
exit:
gt_0trace(listmpshm_debugmask, GT_LEAVE,
"listmp_sharedmemory_params_init");
printk(KERN_ERR "listmp_sharedmemory_params_init failed! "
"status = 0x%x\n", status);
return;
}
......@@ -438,10 +423,6 @@ listmp_sharedmemory_handle listmp_sharedmemory_create(
s32 status = 0;
listmp_sharedmemory_object *handle = NULL;
gt_1trace(listmpshm_debugmask, GT_ENTER, "listmp_sharedmemory_create",
params);
BUG_ON(params == NULL);
if (atomic_cmpmask_and_lt(&(listmp_sharedmemory_state.ref_count),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(0),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(1)) == true) {
......@@ -469,8 +450,10 @@ listmp_sharedmemory_handle listmp_sharedmemory_create(
_listmp_sharedmemory_create(params, true);
exit:
gt_2trace(listmpshm_debugmask, GT_LEAVE, "listmp_sharedmemory_create",
status, handle);
if (status < 0) {
printk(KERN_ERR "listmp_sharedmemory_create failed! "
"status = 0x%x\n", status);
}
return (listmp_sharedmemory_handle) handle;
}
......@@ -487,10 +470,6 @@ int listmp_sharedmemory_delete(listmp_sharedmemory_handle *listmp_handleptr)
listmp_sharedmemory_params *params = NULL;
u32 key;
gt_1trace(listmpshm_debugmask, GT_ENTER, "listmp_sharedmemory_delete",
listmp_handleptr);
BUG_ON(listmp_handleptr == NULL);
if (atomic_cmpmask_and_lt(&(listmp_sharedmemory_state.ref_count),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(0),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(1)) == true) {
......@@ -557,6 +536,10 @@ int listmp_sharedmemory_delete(listmp_sharedmemory_handle *listmp_handleptr)
*listmp_handleptr = NULL;
exit:
if (status < 0) {
printk(KERN_ERR "listmp_sharedmemory_delete failed! "
"status = 0x%x\n", status);
}
return status;
}
......@@ -572,9 +555,6 @@ int listmp_sharedmemory_shared_memreq(listmp_sharedmemory_params *params)
{
int retval = 0;
gt_1trace(listmpshm_debugmask, GT_ENTER,
"listmp_sharedmemory_sharedMemReq", params);
if (WARN_ON(params == NULL)) {
retval = -EINVAL;
goto exit;
......@@ -584,8 +564,10 @@ int listmp_sharedmemory_shared_memreq(listmp_sharedmemory_params *params)
retval = (LISTMP_SHAREDMEMORY_CACHESIZE * 2);
exit:
gt_1trace(listmpshm_debugmask, GT_LEAVE,
"listmp_sharedmemory_sharedMemReq", retVal);
if (retval < 0) {
printk(KERN_ERR "listmp_sharedmemory_shared_memreq failed! "
"retval = 0x%x\n", retval);
}
/*! @retval ((1 * sizeof(struct listmp_elem))
*! + 1 * sizeof(struct listmp_attrs)) if params is null */
/*! @retval (2 * cacheSize) if params is provided */
......@@ -608,11 +590,6 @@ int listmp_sharedmemory_open(listmp_sharedmemory_handle *listmp_handleptr,
u32 shared_shm_base;
struct listmp_attrs *attrs;
gt_1trace(listmpshm_debugmask, GT_ENTER,
"listmp_sharedmemory_open", params);
BUG_ON(listmp_handleptr == NULL);
BUG_ON(params == NULL);
if (atomic_cmpmask_and_lt(&(listmp_sharedmemory_state.ref_count),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(0),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(1)) == true) {
......@@ -714,10 +691,12 @@ int listmp_sharedmemory_open(listmp_sharedmemory_handle *listmp_handleptr,
if (likely(status >= 0))
*listmp_handleptr = (listmp_sharedmemory_handle)
_listmp_sharedmemory_create(params, false);
exit:
gt_1trace(listmpshm_debugmask, GT_LEAVE, "listmp_sharedmemory_open",
status);
/*! @retval LISTMPSHAREDMEMORY_SUCCESS Operation Successful*/
if (status < 0) {
printk(KERN_ERR "listmp_sharedmemory_open failed! "
"status = 0x%x\n", status);
}
return status;
}
......@@ -734,10 +713,6 @@ int listmp_sharedmemory_close(listmp_sharedmemory_handle listmp_handle)
listmp_sharedmemory_params *params = NULL;
u32 key;
gt_1trace(listmpshm_debugmask, GT_ENTER, "listmp_sharedmemory_close",
listmp_handle);
BUG_ON(listmp_handle == NULL);
if (atomic_cmpmask_and_lt(&(listmp_sharedmemory_state.ref_count),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(0),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(1)) == true) {
......@@ -745,7 +720,7 @@ int listmp_sharedmemory_close(listmp_sharedmemory_handle listmp_handle)
goto exit;
}
if (listmp_handle == NULL) {
if (WARN_ON(listmp_handle == NULL)) {
status = -EINVAL;
goto exit;
}
......@@ -781,8 +756,10 @@ int listmp_sharedmemory_close(listmp_sharedmemory_handle listmp_handle)
mutex_unlock(listmp_sharedmemory_state.local_gate);
exit:
gt_1trace(listmpshm_debugmask, GT_LEAVE, "listmp_sharedmemory_close",
status);
if (status < 0) {
printk(KERN_ERR "listmp_sharedmemory_close failed! "
"status = 0x%x\n", status);
}
return status;
}
......@@ -801,9 +778,6 @@ bool listmp_sharedmemory_empty(listmp_sharedmemory_handle listmp_handle)
s32 retval = 0;
struct listmp_elem *sharedHead;
gt_1trace(listmpshm_debugmask, GT_ENTER, "listmp_sharedmemory_empty",
listmp_handle);
if (atomic_cmpmask_and_lt(&(listmp_sharedmemory_state.ref_count),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(0),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(1)) == true) {
......@@ -838,8 +812,6 @@ bool listmp_sharedmemory_empty(listmp_sharedmemory_handle listmp_handle)
gatepeterson_leave(obj->params.gate, 0);
exit:
gt_1trace(listmpshm_debugmask, GT_LEAVE, "listmp_sharedmemory_empty",
is_empty);
return is_empty;
}
......@@ -858,9 +830,6 @@ void *listmp_sharedmemory_get_head(listmp_sharedmemory_handle listmp_handle)
struct listmp_elem *sharedHead = NULL;
s32 retval = 0;
gt_1trace(listmpshm_debugmask, GT_ENTER, "listmp_sharedmemory_get_head",
listmp_handle);
if (atomic_cmpmask_and_lt(&(listmp_sharedmemory_state.ref_count),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(0),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(1)) == true)
......@@ -906,8 +875,6 @@ void *listmp_sharedmemory_get_head(listmp_sharedmemory_handle listmp_handle)
gatepeterson_leave(obj->params.gate, 0);
exit:
gt_1trace(listmpshm_debugmask, GT_LEAVE, "listmp_sharedmemory_get_head",
elem);
return elem;
}
......@@ -927,9 +894,6 @@ void *listmp_sharedmemory_get_tail(listmp_sharedmemory_handle listmp_handle)
struct listmp_elem *sharedHead = NULL;
s32 retval = 0;
gt_1trace(listmpshm_debugmask, GT_ENTER,
"listmp_sharedmemory_get_tail", listmp_handle);
if (atomic_cmpmask_and_lt(&(listmp_sharedmemory_state.ref_count),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(0),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(1)) == true)
......@@ -976,8 +940,6 @@ void *listmp_sharedmemory_get_tail(listmp_sharedmemory_handle listmp_handle)
gatepeterson_leave(obj->params.gate, 0);
exit:
gt_1trace(listmpshm_debugmask, GT_LEAVE, "listmp_sharedmemory_get_tail",
elem);
return elem;
}
......@@ -998,9 +960,6 @@ int listmp_sharedmemory_put_head(listmp_sharedmemory_handle listmp_handle,
s32 retval = 0;
u32 index;
gt_1trace(listmpshm_debugmask, GT_ENTER,
"listmp_sharedmemory_put_head", listmp_handle);
if (atomic_cmpmask_and_lt(&(listmp_sharedmemory_state.ref_count),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(0),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(1)) == true) {
......@@ -1040,9 +999,10 @@ int listmp_sharedmemory_put_head(listmp_sharedmemory_handle listmp_handle,
gatepeterson_leave(obj->params.gate, 0);
exit:
gt_1trace(listmpshm_debugmask, GT_LEAVE, "listmp_sharedmemory_put_head",
status);
/*! @retval LISTMPSHAREDMEMORY_SUCCESS Operation Successful*/
if (status < 0) {
printk(KERN_ERR "listmp_sharedmemory_put_head failed! "
"status = 0x%x\n", status);
}
return status;
}
......@@ -1063,9 +1023,6 @@ int listmp_sharedmemory_put_tail(listmp_sharedmemory_handle listmp_handle,
s32 retval = 0;
u32 index;
gt_2trace(listmpshm_debugmask, GT_ENTER, "listmp_sharedmemory_put_tail",
listmp_handle, elem);
if (atomic_cmpmask_and_lt(&(listmp_sharedmemory_state.ref_count),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(0),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(1)) == true) {
......@@ -1108,8 +1065,10 @@ int listmp_sharedmemory_put_tail(listmp_sharedmemory_handle listmp_handle,
gatepeterson_leave(obj->params.gate, 0);
exit:
gt_1trace(listmpshm_debugmask, GT_LEAVE, "listmp_sharedmemory_put_tail",
status);
if (status < 0) {
printk(KERN_ERR "listmp_sharedmemory_put_tail failed! "
"status = 0x%x\n", status);
}
return status;
}
......@@ -1131,10 +1090,6 @@ int listmp_sharedmemory_insert(listmp_sharedmemory_handle listmp_handle,
s32 retval = 0;
u32 index;
gt_3trace(listmpshm_debugmask, GT_ENTER, "listmp_sharedmemory_insert",
listmp_handle, new_elem, cur_elem);
if (atomic_cmpmask_and_lt(&(listmp_sharedmemory_state.ref_count),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(0),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(1)) == true) {
......@@ -1184,8 +1139,10 @@ int listmp_sharedmemory_insert(listmp_sharedmemory_handle listmp_handle,
gatepeterson_leave(obj->params.gate, 0);
exit:
gt_1trace(listmpshm_debugmask, GT_LEAVE, "listmp_sharedmemory_insert",
status);
if (status < 0) {
printk(KERN_ERR "listmp_sharedmemory_insert failed! "
"status = 0x%x\n", status);
}
return status;
}
......@@ -1204,10 +1161,6 @@ int listmp_sharedmemory_remove(listmp_sharedmemory_handle listmp_handle,
struct listmp_elem *localNextElem = NULL;
s32 retval = 0;
gt_2trace(listmpshm_debugmask, GT_ENTER, "listmp_sharedmemory_remove",
listmp_handle,
elem);
if (atomic_cmpmask_and_lt(&(listmp_sharedmemory_state.ref_count),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(0),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(1)) == true) {
......@@ -1241,8 +1194,10 @@ int listmp_sharedmemory_remove(listmp_sharedmemory_handle listmp_handle,
gatepeterson_leave(obj->params.gate, 0);
exit:
gt_1trace(listmpshm_debugmask, GT_LEAVE, "listmp_sharedmemory_remove",
status);
if (status < 0) {
printk(KERN_ERR "listmp_sharedmemory_remove failed! "
"status = 0x%x\n", status);
}
return status;
}
......@@ -1260,11 +1215,6 @@ void *listmp_sharedmemory_next(listmp_sharedmemory_handle listmp_handle,
struct listmp_elem *sharedNextElem = NULL;
s32 retval = 0;
gt_2trace(listmpshm_debugmask, GT_ENTER, "listmp_sharedmemory_next",
listmp_handle,
elem);
if (atomic_cmpmask_and_lt(&(listmp_sharedmemory_state.ref_count),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(0),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(1)) == true)
......@@ -1294,8 +1244,6 @@ void *listmp_sharedmemory_next(listmp_sharedmemory_handle listmp_handle,
gatepeterson_leave(obj->params.gate, 0);
exit:
gt_1trace(listmpshm_debugmask, GT_LEAVE, "listmp_sharedmemory_next",
retElem);
return retElem;
}
......@@ -1313,10 +1261,6 @@ void *listmp_sharedmemory_prev(listmp_sharedmemory_handle listmp_handle,
struct listmp_elem *sharedPrevElem = NULL;
s32 retval = 0;
gt_2trace(listmpshm_debugmask, GT_ENTER, "listmp_sharedmemory_prev",
listmp_handle,
elem);
if (atomic_cmpmask_and_lt(&(listmp_sharedmemory_state.ref_count),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(0),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(1)) == true)
......@@ -1348,8 +1292,6 @@ void *listmp_sharedmemory_prev(listmp_sharedmemory_handle listmp_handle,
gatepeterson_leave(obj->params.gate, 0);
exit:
gt_1trace(listmpshm_debugmask, GT_LEAVE, "listmp_sharedmemory_prev",
retElem);
return retElem;
}
......@@ -1370,9 +1312,6 @@ listmp_sharedmemory_handle _listmp_sharedmemory_create(
u32 shmIndex;
u32 *sharedShmBase;
gt_1trace(listmpshm_debugmask, GT_ENTER, "_listmp_sharedmemory_create",
params);
BUG_ON(params == NULL);
/* Allow local lock not being provided. Don't do protection if local
......@@ -1448,15 +1387,10 @@ listmp_sharedmemory_handle _listmp_sharedmemory_create(
obj->owner = kmalloc(sizeof(struct listmp_proc_attrs),
GFP_KERNEL);
if (obj->owner == NULL) {
gt_2trace(listmpshm_debugmask,
GT_4CLASS,
"_listmp_sharedmemory_create",
status,
"Memory allocation failed"
"for processor information!");
printk(KERN_ERR "_listmp_sharedmemory_create: Memory "
"allocation failed for processor information!\n");
status = -ENOMEM;
} else {
/* Update owner and opener details */
if (create_flag == true) {
obj->owner->creator = true;
......@@ -1531,7 +1465,9 @@ listmp_sharedmemory_handle _listmp_sharedmemory_create(
}
exit:
gt_1trace(listmpshm_debugmask, GT_LEAVE, "_listmp_sharedmemory_create",
handle);
if (status < 0) {
printk(KERN_ERR "_listmp_sharedmemory_create failed! "
"status = 0x%x\n", status);
}
return (listmp_sharedmemory_handle) handle;
}
......@@ -23,8 +23,6 @@
#include <linux/bug.h>
#include <linux/fs.h>
#include <linux/mm.h>
/* Syslink headers */
#include <gt.h>
/* Module Headers */
#include <listmp.h>
......@@ -573,10 +571,6 @@ int listmp_sharedmemory_ioctl(struct inode *inode, struct file *filp,
struct listmp_sharedmemory_cmd_args cargs;
unsigned long size;
gt_4trace(curTrace, GT_ENTER, "listmp_sharedmemory_ioctl"
"inode: %x, filp: %x,\n cmd: %x, args: %x",
inode, filp, cmd, args);
if (_IOC_DIR(cmd) & _IOC_READ)
os_status = !access_ok(VERIFY_WRITE, uarg, _IOC_SIZE(cmd));
else if (_IOC_DIR(cmd) & _IOC_WRITE)
......@@ -682,8 +676,10 @@ int listmp_sharedmemory_ioctl(struct inode *inode, struct file *filp,
os_status = -EFAULT;
goto exit;
}
return os_status;
exit:
gt_1trace(curTrace, GT_LEAVE, "listmp_sharedmemory_ioctl", os_status);
printk(KERN_ERR "listmp_sharedmemory_ioctl failed: status = 0x%x\n",
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