Skip to content

Commit

Permalink
staging: csr: remove CsrCharString typedef
Browse files Browse the repository at this point in the history
Use char instead.

Cc: Mikko Virkkilä <mikko.virkkila@bluegiga.com>
Cc: Lauri Hintsala <Lauri.Hintsala@bluegiga.com>
Cc: Riku Mettälä <riku.mettala@bluegiga.com>
Cc: Veli-Pekka Peltola <veli-pekka.peltola@bluegiga.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Greg Kroah-Hartman committed Jul 20, 2012
1 parent 7f5393e commit c781b96
Show file tree
Hide file tree
Showing 45 changed files with 298 additions and 301 deletions.
2 changes: 1 addition & 1 deletion drivers/staging/csr/csr_formatted_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "csr_formatted_io.h"
#include "csr_util.h"

s32 CsrSnprintf(CsrCharString *dest, CsrSize n, const CsrCharString *fmt, ...)
s32 CsrSnprintf(char *dest, CsrSize n, const char *fmt, ...)
{
s32 r;
va_list args;
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/csr/csr_formatted_io.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ extern "C" {

#include "csr_types.h"

s32 CsrSnprintf(CsrCharString *dest, CsrSize n, const CsrCharString *fmt, ...);
s32 CsrSnprintf(char *dest, CsrSize n, const char *fmt, ...);

#ifdef __cplusplus
}
Expand Down
8 changes: 4 additions & 4 deletions drivers/staging/csr/csr_framework_ext.h
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ void CsrGlobalMutexUnlock(void);
*----------------------------------------------------------------------------*/
CsrResult CsrThreadCreate(void (*threadFunction)(void *pointer), void *pointer,
u32 stackSize, u16 priority,
const CsrCharString *threadName, CsrThreadHandle *threadHandle);
const char *threadName, CsrThreadHandle *threadHandle);

/*----------------------------------------------------------------------------*
* NAME
Expand Down Expand Up @@ -257,7 +257,7 @@ void CsrThreadSleep(u16 sleepTimeInMs);
*----------------------------------------------------------------------------*/
#ifdef CSR_MEM_DEBUG
void *CsrMemAllocDebug(CsrSize size,
const CsrCharString *file, u32 line);
const char *file, u32 line);
#define CsrMemAlloc(sz) CsrMemAllocDebug((sz), __FILE__, __LINE__)
#else
void *CsrMemAlloc(CsrSize size);
Expand All @@ -278,7 +278,7 @@ void *CsrMemAlloc(CsrSize size);
*----------------------------------------------------------------------------*/
#ifdef CSR_MEM_DEBUG
void *CsrMemCallocDebug(CsrSize numberOfElements, CsrSize elementSize,
const CsrCharString *file, u32 line);
const char *file, u32 line);
#define CsrMemCalloc(cnt, sz) CsrMemAllocDebug((cnt), (sz), __FILE__, __LINE__)
#else
void *CsrMemCalloc(CsrSize numberOfElements, CsrSize elementSize);
Expand Down Expand Up @@ -311,7 +311,7 @@ void CsrMemFree(void *pointer);
*----------------------------------------------------------------------------*/
#ifdef CSR_MEM_DEBUG
void *CsrMemAllocDmaDebug(CsrSize size,
const CsrCharString *file, u32 line);
const char *file, u32 line);
#define CsrMemAllocDma(sz) CsrMemAllocDmaDebug((sz), __FILE__, __LINE__)
#else
void *CsrMemAllocDma(CsrSize size);
Expand Down
8 changes: 4 additions & 4 deletions drivers/staging/csr/csr_lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ typedef struct
{
CsrPrim type;
u16 value1;
CsrCharString *value2;
char *value2;
} CsrEventCsrUint16CsrCharString;

/*----------------------------------------------------------------------------*
Expand All @@ -130,7 +130,7 @@ typedef struct
* Allocates and fills in a message with the signature CsrEventCsrUint16CsrCharString
*
*----------------------------------------------------------------------------*/
CsrEventCsrUint16CsrCharString *CsrEventCsrUint16CsrCharString_struct(u16 primtype, u16 msgtype, u16 value1, CsrCharString *value2);
CsrEventCsrUint16CsrCharString *CsrEventCsrUint16CsrCharString_struct(u16 primtype, u16 msgtype, u16 value1, char *value2);

typedef struct
{
Expand Down Expand Up @@ -169,7 +169,7 @@ typedef struct
{
CsrPrim type;
u32 value1;
CsrCharString *value2;
char *value2;
} CsrEventCsrUint32CsrCharString;

/*----------------------------------------------------------------------------*
Expand All @@ -180,7 +180,7 @@ typedef struct
* Allocates and fills in a message with the signature CsrEventCsrUint32CsrCharString
*
*----------------------------------------------------------------------------*/
CsrEventCsrUint32CsrCharString *CsrEventCsrUint32CsrCharString_struct(u16 primtype, u16 msgtype, u32 value1, CsrCharString *value2);
CsrEventCsrUint32CsrCharString *CsrEventCsrUint32CsrCharString_struct(u16 primtype, u16 msgtype, u32 value1, char *value2);

#ifdef __cplusplus
}
Expand Down
40 changes: 20 additions & 20 deletions drivers/staging/csr/csr_log.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ CsrBool CsrLogTaskIsFiltered(CsrSchedQid taskId, CsrLogLevelTask level);
do { \
if (!(cond)) \
{ \
CsrCharString *panic_arg = "[" __FILE__ ":" CSR_LOG_STRINGIFY(__LINE__) "] - " CSR_LOG_STRINGIFY(cond); \
char *panic_arg = "[" __FILE__ ":" CSR_LOG_STRINGIFY(__LINE__) "] - " CSR_LOG_STRINGIFY(cond); \
CsrPanic(CSR_TECH_FW, CSR_PANIC_FW_ASSERTION_FAIL, panic_arg); \
} \
} while (0)
Expand All @@ -97,13 +97,13 @@ CsrBool CsrLogTaskIsFiltered(CsrSchedQid taskId, CsrLogLevelTask level);
typedef struct
{
u16 primitiveType;
const CsrCharString *primitiveName;
const char *primitiveName;
CsrMsgConvMsgEntry *messageConv; /* Private - do not use */
} CsrLogPrimitiveInformation;

typedef struct
{
const CsrCharString *techVer;
const char *techVer;
u32 primitiveInfoCount;
CsrLogPrimitiveInformation *primitiveInfo;
} CsrLogTechInformation;
Expand Down Expand Up @@ -140,9 +140,9 @@ typedef u32 bitmask32_t;
#endif

/* DEPRECATED - replaced by csr_log_text.h */
void CsrLogTaskText(const CsrCharString *text,
void CsrLogTaskText(const char *text,
u32 line,
const CsrCharString *file);
const char *file);

#define CSR_LOG_STATE_TRANSITION_MASK_FSM_NAME (0x001)
#define CSR_LOG_STATE_TRANSITION_MASK_NEXT_STATE (0x002)
Expand All @@ -155,15 +155,15 @@ void CsrLogTaskText(const CsrCharString *text,
/* DEPRECATED - replaced by csr_log_text.h */
void CsrLogStateTransition(bitmask16_t mask,
u32 identifier,
const CsrCharString *fsm_name,
const char *fsm_name,
u32 prev_state,
const CsrCharString *prev_state_str,
const char *prev_state_str,
u32 in_event,
const CsrCharString *in_event_str,
const char *in_event_str,
u32 next_state,
const CsrCharString *next_state_str,
const char *next_state_str,
u32 line,
const CsrCharString *file);
const char *file);

/*---------------------------------*/
/* BSP logging */
Expand All @@ -174,7 +174,7 @@ void CsrLogSchedDeinit(u8 thread_id);
void CsrLogSchedStart(u8 thread_id);
void CsrLogSchedStop(u8 thread_id);

void CsrLogInitTask(u8 thread_id, CsrSchedQid tskid, const CsrCharString *tskName);
void CsrLogInitTask(u8 thread_id, CsrSchedQid tskid, const char *tskName);
void CsrLogDeinitTask(u16 task_id);

void CsrLogActivate(CsrSchedQid tskid);
Expand All @@ -184,7 +184,7 @@ void CsrLogDeactivate(CsrSchedQid tskid);
#define SYNERGY_SERIALIZER_TYPE_SER (0x001)

void CsrLogMessagePut(u32 line,
const CsrCharString *file,
const char *file,
CsrSchedQid src_task_id,
CsrSchedQid dst_taskid,
CsrSchedMsgId msg_id,
Expand All @@ -199,7 +199,7 @@ void CsrLogMessageGet(CsrSchedQid src_task_id,
const void *msg);

void CsrLogTimedEventIn(u32 line,
const CsrCharString *file,
const char *file,
CsrSchedQid task_id,
CsrSchedTid tid,
CsrTime requested_delay,
Expand All @@ -213,14 +213,14 @@ void CsrLogTimedEventDone(CsrSchedQid task_id,
CsrSchedTid tid);

void CsrLogTimedEventCancel(u32 line,
const CsrCharString *file,
const char *file,
CsrSchedQid task_id,
CsrSchedTid tid,
CsrBool cancel_res);

void CsrLogBgintRegister(u8 thread_id,
CsrSchedBgint irq,
const CsrCharString *callback,
const char *callback,
const void *ptr);
void CsrLogBgintUnregister(CsrSchedBgint irq);
void CsrLogBgintSet(CsrSchedBgint irq);
Expand All @@ -231,17 +231,17 @@ void CsrLogExceptionStateEvent(u16 prim_type,
CsrPrim msg_type,
u16 state,
u32 line,
const CsrCharString *file);
const char *file);
void CsrLogExceptionGeneral(u16 prim_type,
u16 state,
const CsrCharString *text,
const char *text,
u32 line,
const CsrCharString *file);
const char *file);
void CsrLogExceptionWarning(u16 prim_type,
u16 state,
const CsrCharString *text,
const char *text,
u32 line,
const CsrCharString *file);
const char *file);

#ifdef __cplusplus
}
Expand Down
4 changes: 2 additions & 2 deletions drivers/staging/csr/csr_log_configure.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ void CsrLogLevelTextSetTaskSubOrigin(CsrLogTextTaskId taskId, u16 subOrigin, Csr
sub origin(s).
*******************************************************************************/
void CsrLogLevelTextSet(const CsrCharString *originName,
const CsrCharString *subOriginName,
void CsrLogLevelTextSet(const char *originName,
const char *subOriginName,
CsrLogLevelText warningLevelMask);

#ifdef __cplusplus
Expand Down
24 changes: 12 additions & 12 deletions drivers/staging/csr/csr_log_text.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@ extern "C" {
typedef struct CsrLogSubOrigin
{
u16 subOriginNumber; /* Id of the given SubOrigin */
const CsrCharString *subOriginName; /* Prefix Text for this SubOrigin */
const char *subOriginName; /* Prefix Text for this SubOrigin */
} CsrLogSubOrigin;

/* Register a task which is going to use the CSR_LOG_TEXT_XXX interface */
#ifdef CSR_LOG_ENABLE
void CsrLogTextRegister(CsrLogTextTaskId taskId, const CsrCharString *taskName, u16 subOriginsLength, const CsrLogSubOrigin *subOrigins);
void CsrLogTextRegister(CsrLogTextTaskId taskId, const char *taskName, u16 subOriginsLength, const CsrLogSubOrigin *subOrigins);
#else
#define CsrLogTextRegister(taskId, taskName, subOriginsLength, subOrigins)
#endif

/* CRITICAL: Conditions that are threatening to the integrity/stability of the
system as a whole. */
#if defined(CSR_LOG_ENABLE) && !defined(CSR_LOG_LEVEL_TEXT_CRITICAL_DISABLE)
void CsrLogTextCritical(CsrLogTextTaskId taskId, u16 subOrigin, const CsrCharString *formatString, ...);
void CsrLogTextBufferCritical(CsrLogTextTaskId taskId, u16 subOrigin, CsrSize bufferLength, const void *buffer, const CsrCharString *formatString, ...);
void CsrLogTextCritical(CsrLogTextTaskId taskId, u16 subOrigin, const char *formatString, ...);
void CsrLogTextBufferCritical(CsrLogTextTaskId taskId, u16 subOrigin, CsrSize bufferLength, const void *buffer, const char *formatString, ...);
#define CSR_LOG_TEXT_CRITICAL(taskId_subOrigin_formatString_varargs) CsrLogTextCritical taskId_subOrigin_formatString_varargs
#define CSR_LOG_TEXT_CONDITIONAL_CRITICAL(condition, logtextargs) {if (condition) {CSR_LOG_TEXT_CRITICAL(logtextargs);}}
#define CSR_LOG_TEXT_BUFFER_CRITICAL(taskId_subOrigin_length_buffer_formatString_varargs) CsrLogTextBufferCritical taskId_subOrigin_length_buffer_formatString_varargs
Expand All @@ -49,8 +49,8 @@ void CsrLogTextBufferCritical(CsrLogTextTaskId taskId, u16 subOrigin, CsrSize bu
/* ERROR: Malfunction of a component rendering it unable to operate correctly,
causing lack of functionality but not loss of system integrity/stability. */
#if defined(CSR_LOG_ENABLE) && !defined(CSR_LOG_LEVEL_TEXT_ERROR_DISABLE)
void CsrLogTextError(CsrLogTextTaskId taskId, u16 subOrigin, const CsrCharString *formatString, ...);
void CsrLogTextBufferError(CsrLogTextTaskId taskId, u16 subOrigin, CsrSize bufferLength, const void *buffer, const CsrCharString *formatString, ...);
void CsrLogTextError(CsrLogTextTaskId taskId, u16 subOrigin, const char *formatString, ...);
void CsrLogTextBufferError(CsrLogTextTaskId taskId, u16 subOrigin, CsrSize bufferLength, const void *buffer, const char *formatString, ...);
#define CSR_LOG_TEXT_ERROR(taskId_subOrigin_formatString_varargs) CsrLogTextError taskId_subOrigin_formatString_varargs
#define CSR_LOG_TEXT_CONDITIONAL_ERROR(condition, logtextargs) {if (condition) {CSR_LOG_TEXT_ERROR(logtextargs);}}
#define CSR_LOG_TEXT_BUFFER_ERROR(taskId_subOrigin_length_buffer_formatString_varargs) CsrLogTextBufferError taskId_subOrigin_length_buffer_formatString_varargs
Expand All @@ -66,8 +66,8 @@ void CsrLogTextBufferError(CsrLogTextTaskId taskId, u16 subOrigin, CsrSize buffe
or violations of specifications, where the result of such deviations does not
lead to malfunction of the component. */
#if defined(CSR_LOG_ENABLE) && !defined(CSR_LOG_LEVEL_TEXT_WARNING_DISABLE)
void CsrLogTextWarning(CsrLogTextTaskId taskId, u16 subOrigin, const CsrCharString *formatString, ...);
void CsrLogTextBufferWarning(CsrLogTextTaskId taskId, u16 subOrigin, CsrSize bufferLength, const void *buffer, const CsrCharString *formatString, ...);
void CsrLogTextWarning(CsrLogTextTaskId taskId, u16 subOrigin, const char *formatString, ...);
void CsrLogTextBufferWarning(CsrLogTextTaskId taskId, u16 subOrigin, CsrSize bufferLength, const void *buffer, const char *formatString, ...);
#define CSR_LOG_TEXT_WARNING(taskId_subOrigin_formatString_varargs) CsrLogTextWarning taskId_subOrigin_formatString_varargs
#define CSR_LOG_TEXT_CONDITIONAL_WARNING(condition, logtextargs) {if (condition) {CSR_LOG_TEXT_WARNING(logtextargs);}}
#define CSR_LOG_TEXT_BUFFER_WARNING(taskId_subOrigin_length_buffer_formatString_varargs) CsrLogTextBufferWarning taskId_subOrigin_length_buffer_formatString_varargs
Expand All @@ -82,8 +82,8 @@ void CsrLogTextBufferWarning(CsrLogTextTaskId taskId, u16 subOrigin, CsrSize buf
/* INFO: Important events that may aid in determining the conditions under which
the more severe conditions are encountered. */
#if defined(CSR_LOG_ENABLE) && !defined(CSR_LOG_LEVEL_TEXT_INFO_DISABLE)
void CsrLogTextInfo(CsrLogTextTaskId taskId, u16 subOrigin, const CsrCharString *formatString, ...);
void CsrLogTextBufferInfo(CsrLogTextTaskId taskId, u16 subOrigin, CsrSize bufferLength, const void *buffer, const CsrCharString *formatString, ...);
void CsrLogTextInfo(CsrLogTextTaskId taskId, u16 subOrigin, const char *formatString, ...);
void CsrLogTextBufferInfo(CsrLogTextTaskId taskId, u16 subOrigin, CsrSize bufferLength, const void *buffer, const char *formatString, ...);
#define CSR_LOG_TEXT_INFO(taskId_subOrigin_formatString_varargs) CsrLogTextInfo taskId_subOrigin_formatString_varargs
#define CSR_LOG_TEXT_CONDITIONAL_INFO(condition, logtextargs) {if (condition) {CSR_LOG_TEXT_INFO(logtextargs);}}
#define CSR_LOG_TEXT_BUFFER_INFO(taskId_subOrigin_length_buffer_formatString_varargs) CsrLogTextBufferInfo taskId_subOrigin_length_buffer_formatString_varargs
Expand All @@ -97,8 +97,8 @@ void CsrLogTextBufferInfo(CsrLogTextTaskId taskId, u16 subOrigin, CsrSize buffer

/* DEBUG: Similar to INFO, but dedicated to events that occur more frequently. */
#if defined(CSR_LOG_ENABLE) && !defined(CSR_LOG_LEVEL_TEXT_DEBUG_DISABLE)
void CsrLogTextDebug(CsrLogTextTaskId taskId, u16 subOrigin, const CsrCharString *formatString, ...);
void CsrLogTextBufferDebug(CsrLogTextTaskId taskId, u16 subOrigin, CsrSize bufferLength, const void *buffer, const CsrCharString *formatString, ...);
void CsrLogTextDebug(CsrLogTextTaskId taskId, u16 subOrigin, const char *formatString, ...);
void CsrLogTextBufferDebug(CsrLogTextTaskId taskId, u16 subOrigin, CsrSize bufferLength, const void *buffer, const char *formatString, ...);
#define CSR_LOG_TEXT_DEBUG(taskId_subOrigin_formatString_varargs) CsrLogTextDebug taskId_subOrigin_formatString_varargs
#define CSR_LOG_TEXT_CONDITIONAL_DEBUG(condition, logtextargs) {if (condition) {CSR_LOG_TEXT_DEBUG(logtextargs);}}
#define CSR_LOG_TEXT_BUFFER_DEBUG(taskId_subOrigin_length_buffer_formatString_varargs) CsrLogTextBufferDebug taskId_subOrigin_length_buffer_formatString_varargs
Expand Down
6 changes: 3 additions & 3 deletions drivers/staging/csr/csr_msgconv.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ void CsrMsgConvDeinit(void);

/* SHOULD BE INTERNAL TO FRAMEWORK AKA DEPRECATED */

u32 CsrCharStringSerLen(const CsrCharString *str);
u32 CsrCharStringSerLen(const char *str);
u32 CsrUtf8StringSerLen(const u8 *str);
u32 CsrUtf16StringSerLen(const u16 *str);

Expand All @@ -82,7 +82,7 @@ void CsrUint8Ser(u8 *buffer, CsrSize *offset, u8 value);
void CsrUint16Ser(u8 *buffer, CsrSize *offset, u16 value);
void CsrUint32Ser(u8 *buffer, CsrSize *offset, u32 value);
void CsrMemCpySer(u8 *buffer, CsrSize *offset, const void *value, CsrSize length);
void CsrCharStringSer(u8 *buffer, CsrSize *offset, const CsrCharString *value);
void CsrCharStringSer(u8 *buffer, CsrSize *offset, const char *value);
void CsrUtf8StringSer(u8 *buffer, CsrSize *offset, const u8 *value);
void CsrUtf16StringSer(u8 *buffer, CsrSize *offset, const u16 *value);
void CsrVoidPtrSer(u8 *buffer, CsrSize *offset, void *ptr);
Expand All @@ -92,7 +92,7 @@ void CsrUint8Des(u8 *value, u8 *buffer, CsrSize *offset);
void CsrUint16Des(u16 *value, u8 *buffer, CsrSize *offset);
void CsrUint32Des(u32 *value, u8 *buffer, CsrSize *offset);
void CsrMemCpyDes(void *value, u8 *buffer, CsrSize *offset, CsrSize length);
void CsrCharStringDes(CsrCharString **value, u8 *buffer, CsrSize *offset);
void CsrCharStringDes(char **value, u8 *buffer, CsrSize *offset);
void CsrUtf8StringDes(u8 **value, u8 *buffer, CsrSize *offset);
void CsrUtf16StringDes(u16 **value, u8 *buffer, CsrSize *offset);
void CsrVoidPtrDes(void **value, u8 *buffer, CsrSize *offset);
Expand Down
10 changes: 5 additions & 5 deletions drivers/staging/csr/csr_pmem.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ extern "C" {
*****************************************************************************/
#ifdef CSR_PMEM_DEBUG
void *CsrPmemAllocDebug(CsrSize size,
const CsrCharString *file, u32 line);
const char *file, u32 line);
#define CsrPmemAlloc(sz) CsrPmemAllocDebug((sz), __FILE__, __LINE__)
#else
void *CsrPmemAlloc(CsrSize size);
Expand Down Expand Up @@ -108,8 +108,8 @@ typedef u8 CsrPmemDebugAllocType;
#define CSR_PMEM_DEBUG_TYPE_MEM_CALLOC 3
#define CSR_PMEM_DEBUG_TYPE_MEM_ALLOC_DMA 4

typedef void (CsrPmemDebugOnAlloc)(void *ptr, void *userptr, CsrSize size, CsrPmemDebugAllocType type, const CsrCharString* file, u32 line);
typedef void (CsrPmemDebugOnFree)(void *ptr, void *userptr, CsrPmemDebugAllocType type, const CsrCharString* file, u32 line);
typedef void (CsrPmemDebugOnAlloc)(void *ptr, void *userptr, CsrSize size, CsrPmemDebugAllocType type, const char* file, u32 line);
typedef void (CsrPmemDebugOnFree)(void *ptr, void *userptr, CsrPmemDebugAllocType type, const char* file, u32 line);

/*----------------------------------------------------------------------------*
* NAME
Expand All @@ -127,10 +127,10 @@ typedef void (CsrPmemDebugOnFree)(void *ptr, void *userptr, CsrPmemDebugAllocTyp
*----------------------------------------------------------------------------*/
void CsrPmemDebugInstallHooks(u8 headSize, u8 endSize, CsrPmemDebugOnAlloc *onAllocCallback, CsrPmemDebugOnFree *onFreeCallback);

void *CsrPmemDebugAlloc(CsrSize size, CsrPmemDebugAllocType type, const CsrCharString* file, u32 line);
void *CsrPmemDebugAlloc(CsrSize size, CsrPmemDebugAllocType type, const char* file, u32 line);
#define CsrPmemAlloc(size) CsrPmemDebugAlloc(size, CSR_PMEM_DEBUG_TYPE_PMEM_ALLOC, __FILE__, __LINE__)

void CsrPmemDebugFree(void *ptr, CsrPmemDebugAllocType type, const CsrCharString* file, u32 line);
void CsrPmemDebugFree(void *ptr, CsrPmemDebugAllocType type, const char* file, u32 line);
#define CsrPmemFree(ptr) CsrPmemDebugFree(ptr, CSR_PMEM_DEBUG_TYPE_PMEM_ALLOC, __FILE__, __LINE__)

#endif
Expand Down
Loading

0 comments on commit c781b96

Please sign in to comment.