summaryrefslogtreecommitdiff
path: root/drivers/staging
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-07-20 14:47:11 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-07-20 14:47:11 -0700
commit5a0c09fd736d2518409e0eabe4c3039058e6fdfc (patch)
treec1d316e1c28227e967dff345c061bdc0039d10b4 /drivers/staging
parent6a4f6d38a34a992f8fd1572fc8d5706c11089d5e (diff)
staging: csr: remove CsrStrDup
Use kstrdup() for the few places that called it, and remove CsrUtf8StrDup() as no one calls that function. 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>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/csr/csr_serialize_primitive_types.c4
-rw-r--r--drivers/staging/csr/csr_unicode.h20
-rw-r--r--drivers/staging/csr/csr_utf16.c5
-rw-r--r--drivers/staging/csr/csr_util.c15
-rw-r--r--drivers/staging/csr/csr_util.h5
5 files changed, 2 insertions, 47 deletions
diff --git a/drivers/staging/csr/csr_serialize_primitive_types.c b/drivers/staging/csr/csr_serialize_primitive_types.c
index 2e4a8e909318..419528bf1fa5 100644
--- a/drivers/staging/csr/csr_serialize_primitive_types.c
+++ b/drivers/staging/csr/csr_serialize_primitive_types.c
@@ -49,14 +49,14 @@ EXPORT_SYMBOL_GPL(CsrMemCpyDes);
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;
}
diff --git a/drivers/staging/csr/csr_unicode.h b/drivers/staging/csr/csr_unicode.h
index a6ddb1f5c34f..2105e7110c65 100644
--- a/drivers/staging/csr/csr_unicode.h
+++ b/drivers/staging/csr/csr_unicode.h
@@ -64,26 +64,6 @@ u32 CsrUtf8StringLengthInBytes(const u8 *string);
*******************************************************************************/
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
*
diff --git a/drivers/staging/csr/csr_utf16.c b/drivers/staging/csr/csr_utf16.c
index 3d47491fd9a2..e678713d1675 100644
--- a/drivers/staging/csr/csr_utf16.c
+++ b/drivers/staging/csr/csr_utf16.c
@@ -1053,8 +1053,3 @@ u8 *CsrUtf8StrTruncate(u8 *target, size_t count)
return target;
}
-
-u8 *CsrUtf8StrDup(const u8 *source)
-{
- return (u8 *) CsrStrDup((const char *) source);
-}
diff --git a/drivers/staging/csr/csr_util.c b/drivers/staging/csr/csr_util.c
index fa6025a59c98..ff1b85e5097c 100644
--- a/drivers/staging/csr/csr_util.c
+++ b/drivers/staging/csr/csr_util.c
@@ -58,21 +58,6 @@ s32 CsrVsnprintf(char *string, size_t count, const char *format, va_list args)
}
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");
diff --git a/drivers/staging/csr/csr_util.h b/drivers/staging/csr/csr_util.h
index 024b520a1bb9..2efc3311c93a 100644
--- a/drivers/staging/csr/csr_util.h
+++ b/drivers/staging/csr/csr_util.h
@@ -35,11 +35,6 @@ size_t CsrStrLen(const char *string);
#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