void CsrCharStringDes(char **value, u8 *buffer, size_t *offset)
{
- *value = CsrStrDup((char *) &buffer[*offset]);
+ *value = kstrdup((char *) &buffer[*offset], GFP_KERNEL);
*offset += CsrStrLen(*value) + 1;
}
EXPORT_SYMBOL_GPL(CsrCharStringDes);
void CsrUtf8StringDes(u8 **value, u8 *buffer, size_t *offset)
{
- *value = (u8 *) CsrStrDup((char *) &buffer[*offset]);
+ *value = (u8 *)kstrdup((char *) &buffer[*offset], GFP_KERNEL);
*offset += CsrStrLen((char *) *value) + 1;
}
*******************************************************************************/
u8 *CsrUtf8StrTruncate(u8 *target, size_t count);
-/*******************************************************************************
-
- NAME
- CsrUtf8StrDup
-
- DESCRIPTION
- This function will allocate memory and copy the source string into the
- allocated memory, which is then returned as a duplicate of the original
- string. The memory returned must be freed by calling CsrPmemFree when
- the duplicate is no longer needed.
-
- PARAMETERS
- source - UTF-8 string to be duplicated.
-
- RETURNS
- Returns a duplicate of source.
-
-*******************************************************************************/
-u8 *CsrUtf8StrDup(const u8 *source);
-
/*
* UCS2
*
return target;
}
-
-u8 *CsrUtf8StrDup(const u8 *source)
-{
- return (u8 *) CsrStrDup((const char *) source);
-}
}
EXPORT_SYMBOL_GPL(CsrVsnprintf);
-char *CsrStrDup(const char *string)
-{
- char *copy;
- u32 len;
-
- copy = NULL;
- if (string != NULL)
- {
- len = CsrStrLen(string) + 1;
- copy = CsrPmemAlloc(len);
- CsrMemCpy(copy, string, len);
- }
- return copy;
-}
-
MODULE_DESCRIPTION("CSR Operating System Kernel Abstraction");
MODULE_AUTHOR("Cambridge Silicon Radio Ltd.");
MODULE_LICENSE("GPL and additional rights");
#endif /* !CSR_USE_STDC_LIB */
s32 CsrVsnprintf(char *string, size_t count, const char *format, va_list args);
-/*------------------------------------------------------------------*/
-/* Non-standard utility functions */
-/*------------------------------------------------------------------*/
-char *CsrStrDup(const char *string);
-
#define CsrOffsetOf(st, m) ((size_t) & ((st *) 0)->m)
#ifdef __cplusplus