Commit b6e6e3a8 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

staging: csr: remove CsrStrCpy

It was really just strcpy() so use that instead.  Also remove
CsrUtf8StrCpy() as no one was calling 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: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c80b2e3f
...@@ -123,7 +123,7 @@ void CsrCharStringSer(u8 *buffer, size_t *offset, const char *value) ...@@ -123,7 +123,7 @@ void CsrCharStringSer(u8 *buffer, size_t *offset, const char *value)
{ {
if (value) if (value)
{ {
CsrStrCpy(((char *) &buffer[*offset]), value); strcpy(((char *) &buffer[*offset]), value);
*offset += CsrStrLen(value) + 1; *offset += CsrStrLen(value) + 1;
} }
else else
......
...@@ -66,30 +66,6 @@ u32 CsrUtf8StringLengthInBytes(const u8 *string); ...@@ -66,30 +66,6 @@ u32 CsrUtf8StringLengthInBytes(const u8 *string);
*******************************************************************************/ *******************************************************************************/
u8 *CsrUtf8StrTruncate(u8 *target, size_t count); u8 *CsrUtf8StrTruncate(u8 *target, size_t count);
/*******************************************************************************
NAME
CsrUtf8StrCpy
DESCRIPTION
Copies the null terminated UTF-8 string pointed at by source into the
memory pointed at by target, including the terminating null character.
To avoid overflows, the size of the memory pointed at by target shall be
long enough to contain the same UTF-8 string as source (including the
terminating null character), and should not overlap in memory with
source.
PARAMETERS
target - Pointer to the target memory where the content is to be copied.
source - UTF-8 string to be copied.
RETURNS
Returns target
*******************************************************************************/
u8 *CsrUtf8StrCpy(u8 *target, const u8 *source);
/******************************************************************************* /*******************************************************************************
NAME NAME
......
...@@ -1035,11 +1035,6 @@ u32 CsrUtf8StringLengthInBytes(const u8 *string) ...@@ -1035,11 +1035,6 @@ u32 CsrUtf8StringLengthInBytes(const u8 *string)
return (u32) length; return (u32) length;
} }
u8 *CsrUtf8StrCpy(u8 *target, const u8 *source)
{
return (u8 *) CsrStrCpy((char *) target, (const char *) source);
}
u8 *CsrUtf8StrTruncate(u8 *target, size_t count) u8 *CsrUtf8StrTruncate(u8 *target, size_t count)
{ {
size_t lastByte = count - 1; size_t lastByte = count - 1;
......
...@@ -45,11 +45,6 @@ EXPORT_SYMBOL_GPL(CsrMemCpy); ...@@ -45,11 +45,6 @@ EXPORT_SYMBOL_GPL(CsrMemCpy);
#endif #endif
#ifndef CSR_USE_STDC_LIB #ifndef CSR_USE_STDC_LIB
char *CsrStrCpy(char *dest, const char *src)
{
return strcpy(dest, src);
}
char *CsrStrNCpy(char *dest, const char *src, size_t count) char *CsrStrNCpy(char *dest, const char *src, size_t count)
{ {
return strncpy(dest, src, count); return strncpy(dest, src, count);
......
...@@ -28,7 +28,6 @@ void CsrUInt16ToHex(u16 number, char *str); ...@@ -28,7 +28,6 @@ void CsrUInt16ToHex(u16 number, char *str);
/*------------------------------------------------------------------*/ /*------------------------------------------------------------------*/
#ifdef CSR_USE_STDC_LIB #ifdef CSR_USE_STDC_LIB
#define CsrMemCpy memcpy #define CsrMemCpy memcpy
#define CsrStrCpy strcpy
#define CsrStrNCpy strncpy #define CsrStrNCpy strncpy
#define CsrStrCmp(s1, s2) ((s32) strcmp((s1), (s2))) #define CsrStrCmp(s1, s2) ((s32) strcmp((s1), (s2)))
#define CsrStrNCmp(s1, s2, n) ((s32) strncmp((s1), (s2), (n))) #define CsrStrNCmp(s1, s2, n) ((s32) strncmp((s1), (s2), (n)))
...@@ -36,7 +35,6 @@ void CsrUInt16ToHex(u16 number, char *str); ...@@ -36,7 +35,6 @@ void CsrUInt16ToHex(u16 number, char *str);
#define CsrStrLen strlen #define CsrStrLen strlen
#else /* !CSR_USE_STDC_LIB */ #else /* !CSR_USE_STDC_LIB */
void *CsrMemCpy(void *dest, const void *src, size_t count); void *CsrMemCpy(void *dest, const void *src, size_t count);
char *CsrStrCpy(char *dest, const char *src);
char *CsrStrNCpy(char *dest, const char *src, size_t count); char *CsrStrNCpy(char *dest, const char *src, size_t count);
s32 CsrStrCmp(const char *string1, const char *string2); s32 CsrStrCmp(const char *string1, const char *string2);
s32 CsrStrNCmp(const char *string1, const char *string2, size_t count); s32 CsrStrNCmp(const char *string1, const char *string2, size_t count);
......
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