Skip to content

Commit

Permalink
staging: csr: remove CsrStrCpy
Browse files Browse the repository at this point in the history
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Greg Kroah-Hartman committed Jul 20, 2012
1 parent c80b2e3 commit b6e6e3a
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 37 deletions.
2 changes: 1 addition & 1 deletion drivers/staging/csr/csr_serialize_primitive_types.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ void CsrCharStringSer(u8 *buffer, size_t *offset, const char *value)
{
if (value)
{
CsrStrCpy(((char *) &buffer[*offset]), value);
strcpy(((char *) &buffer[*offset]), value);
*offset += CsrStrLen(value) + 1;
}
else
Expand Down
24 changes: 0 additions & 24 deletions drivers/staging/csr/csr_unicode.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,30 +66,6 @@ u32 CsrUtf8StringLengthInBytes(const u8 *string);
*******************************************************************************/
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
Expand Down
5 changes: 0 additions & 5 deletions drivers/staging/csr/csr_utf16.c
Original file line number Diff line number Diff line change
Expand Up @@ -1035,11 +1035,6 @@ u32 CsrUtf8StringLengthInBytes(const u8 *string)
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)
{
size_t lastByte = count - 1;
Expand Down
5 changes: 0 additions & 5 deletions drivers/staging/csr/csr_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@ EXPORT_SYMBOL_GPL(CsrMemCpy);
#endif

#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)
{
return strncpy(dest, src, count);
Expand Down
2 changes: 0 additions & 2 deletions drivers/staging/csr/csr_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,13 @@ void CsrUInt16ToHex(u16 number, char *str);
/*------------------------------------------------------------------*/
#ifdef CSR_USE_STDC_LIB
#define CsrMemCpy memcpy
#define CsrStrCpy strcpy
#define CsrStrNCpy strncpy
#define CsrStrCmp(s1, s2) ((s32) strcmp((s1), (s2)))
#define CsrStrNCmp(s1, s2, n) ((s32) strncmp((s1), (s2), (n)))
#define CsrStrChr strchr
#define CsrStrLen strlen
#else /* !CSR_USE_STDC_LIB */
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);
s32 CsrStrCmp(const char *string1, const char *string2);
s32 CsrStrNCmp(const char *string1, const char *string2, size_t count);
Expand Down

0 comments on commit b6e6e3a

Please sign in to comment.