From b6e6e3a8408cdd3e9264df98c51953fa36968bee Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 20 Jul 2012 14:23:42 -0700 Subject: [PATCH] staging: csr: remove CsrStrCpy MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit It was really just strcpy() so use that instead. Also remove CsrUtf8StrCpy() as no one was calling that function. Cc: Mikko Virkkilä Cc: Lauri Hintsala Cc: Riku Mettälä Cc: Veli-Pekka Peltola Signed-off-by: Greg Kroah-Hartman --- .../csr/csr_serialize_primitive_types.c | 2 +- drivers/staging/csr/csr_unicode.h | 24 ------------------- drivers/staging/csr/csr_utf16.c | 5 ---- drivers/staging/csr/csr_util.c | 5 ---- drivers/staging/csr/csr_util.h | 2 -- 5 files changed, 1 insertion(+), 37 deletions(-) diff --git a/drivers/staging/csr/csr_serialize_primitive_types.c b/drivers/staging/csr/csr_serialize_primitive_types.c index 5fb026c2710b..2e4a8e909318 100644 --- a/drivers/staging/csr/csr_serialize_primitive_types.c +++ b/drivers/staging/csr/csr_serialize_primitive_types.c @@ -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 diff --git a/drivers/staging/csr/csr_unicode.h b/drivers/staging/csr/csr_unicode.h index 44d7fd95a6b5..b54a9ce94482 100644 --- a/drivers/staging/csr/csr_unicode.h +++ b/drivers/staging/csr/csr_unicode.h @@ -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 diff --git a/drivers/staging/csr/csr_utf16.c b/drivers/staging/csr/csr_utf16.c index 46bd130a248a..db91a73a1d30 100644 --- a/drivers/staging/csr/csr_utf16.c +++ b/drivers/staging/csr/csr_utf16.c @@ -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; diff --git a/drivers/staging/csr/csr_util.c b/drivers/staging/csr/csr_util.c index 20dbe3e040e1..e1e9467cc9ee 100644 --- a/drivers/staging/csr/csr_util.c +++ b/drivers/staging/csr/csr_util.c @@ -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); diff --git a/drivers/staging/csr/csr_util.h b/drivers/staging/csr/csr_util.h index e4987b14216d..c7aa3a6ecee4 100644 --- a/drivers/staging/csr/csr_util.h +++ b/drivers/staging/csr/csr_util.h @@ -28,7 +28,6 @@ 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))) @@ -36,7 +35,6 @@ void CsrUInt16ToHex(u16 number, char *str); #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); -- 2.20.1