summaryrefslogtreecommitdiff
path: root/drivers/staging
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-07-20 14:27:26 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-07-20 14:27:26 -0700
commit310d5940f521840a92e2572603021c9b58aeab5e (patch)
treead44015de7e26a2caf1eb28d403708d7d61f02e7 /drivers/staging
parentb6e6e3a8408cdd3e9264df98c51953fa36968bee (diff)
staging: csr: remove CsrStrNcpy
A few other functions were using it, but no one was calling them, so remove them as well: CsrUtf8StrNCpy() CsrUtf8StrNCpyZero() CsrUtf8StringConcatenateTexts() 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_unicode.h55
-rw-r--r--drivers/staging/csr/csr_utf16.c60
-rw-r--r--drivers/staging/csr/csr_util.c5
-rw-r--r--drivers/staging/csr/csr_util.h2
4 files changed, 0 insertions, 122 deletions
diff --git a/drivers/staging/csr/csr_unicode.h b/drivers/staging/csr/csr_unicode.h
index b54a9ce94482..c27b6f9a87f4 100644
--- a/drivers/staging/csr/csr_unicode.h
+++ b/drivers/staging/csr/csr_unicode.h
@@ -69,59 +69,6 @@ u8 *CsrUtf8StrTruncate(u8 *target, size_t count);
/*******************************************************************************
NAME
- CsrUtf8StrNCpy
-
- DESCRIPTION
- Copies the first count bytes of source to target. If the end of the
- source UTF-8 string (which is signaled by a null-character) is found
- before count bytes have been copied, target is padded with null
- characters until a total of count bytes have been written to it.
-
- No null-character is implicitly appended to the end of target, so target
- will only be null-terminated if the length of the UTF-8 string in source
- is less than count.
-
- PARAMETERS
- target - Pointer to the target memory where the content is to be copied.
- source - UTF-8 string to be copied.
- count - Maximum number of bytes to be written to target.
-
- RETURNS
- Returns target
-
-*******************************************************************************/
-u8 *CsrUtf8StrNCpy(u8 *target, const u8 *source, size_t count);
-
-/*******************************************************************************
-
- NAME
- CsrUtf8StrNCpyZero
-
- DESCRIPTION
- Equivalent to CsrUtf8StrNCpy, but if the length of source is equal to or
- greater than count the target string is truncated on a UTF-8 character
- boundary by writing a null character somewhere in the range
- target[count - 4]:target[count - 1], leaving the target string
- unconditionally null terminated in all cases.
-
- Please note that if the length of source is shorter than count, no
- truncation will be applied, and the target string will be a one to one
- copy of source.
-
- PARAMETERS
- target - Pointer to the target memory where the content is to be copied.
- source - UTF-8 string to be copied.
- count - Maximum number of bytes to be written to target.
-
- RETURNS
- Returns target
-
-*******************************************************************************/
-u8 *CsrUtf8StrNCpyZero(u8 *target, const u8 *source, size_t count);
-
-/*******************************************************************************
-
- NAME
CsrUtf8StrDup
DESCRIPTION
@@ -139,8 +86,6 @@ u8 *CsrUtf8StrNCpyZero(u8 *target, const u8 *source, size_t count);
*******************************************************************************/
u8 *CsrUtf8StrDup(const u8 *source);
-u8 *CsrUtf8StringConcatenateTexts(const u8 *inputText1, const u8 *inputText2, const u8 *inputText3, const u8 *inputText4);
-
/*
* UCS2
*
diff --git a/drivers/staging/csr/csr_utf16.c b/drivers/staging/csr/csr_utf16.c
index db91a73a1d30..ed0d843e4510 100644
--- a/drivers/staging/csr/csr_utf16.c
+++ b/drivers/staging/csr/csr_utf16.c
@@ -1064,67 +1064,7 @@ u8 *CsrUtf8StrTruncate(u8 *target, size_t count)
return target;
}
-u8 *CsrUtf8StrNCpy(u8 *target, const u8 *source, size_t count)
-{
- return (u8 *) CsrStrNCpy((char *) target, (const char *) source, count);
-}
-
-u8 *CsrUtf8StrNCpyZero(u8 *target, const u8 *source, size_t count)
-{
- CsrStrNCpy((char *) target, (const char *) source, count);
- if (target[count - 1] != '\0')
- {
- CsrUtf8StrTruncate(target, count - 1);
- }
- return target;
-}
-
u8 *CsrUtf8StrDup(const u8 *source)
{
return (u8 *) CsrStrDup((const char *) source);
}
-
-u8 *CsrUtf8StringConcatenateTexts(const u8 *inputText1, const u8 *inputText2, const u8 *inputText3, const u8 *inputText4)
-{
- u8 *outputText;
- u32 textLen, textLen1, textLen2, textLen3, textLen4;
-
- textLen1 = CsrUtf8StringLengthInBytes(inputText1);
- textLen2 = CsrUtf8StringLengthInBytes(inputText2);
- textLen3 = CsrUtf8StringLengthInBytes(inputText3);
- textLen4 = CsrUtf8StringLengthInBytes(inputText4);
-
- textLen = textLen1 + textLen2 + textLen3 + textLen4;
-
- if (textLen == 0) /*stop here is all lengths are 0*/
- {
- return NULL;
- }
-
- outputText = (u8 *) CsrPmemAlloc((textLen + 1) * sizeof(u8)); /* add space for 0-termination*/
-
-
- if (inputText1 != NULL)
- {
- CsrUtf8StrNCpy(outputText, inputText1, textLen1);
- }
-
- if (inputText2 != NULL)
- {
- CsrUtf8StrNCpy(&(outputText[textLen1]), inputText2, textLen2);
- }
-
- if (inputText3 != NULL)
- {
- CsrUtf8StrNCpy(&(outputText[textLen1 + textLen2]), inputText3, textLen3);
- }
-
- if (inputText4 != NULL)
- {
- CsrUtf8StrNCpy(&(outputText[textLen1 + textLen2 + textLen3]), inputText4, textLen4);
- }
-
- outputText[textLen] = '\0';
-
- return outputText;
-}
diff --git a/drivers/staging/csr/csr_util.c b/drivers/staging/csr/csr_util.c
index e1e9467cc9ee..87075cdf5999 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 *CsrStrNCpy(char *dest, const char *src, size_t count)
-{
- return strncpy(dest, src, count);
-}
-
size_t CsrStrLen(const char *string)
{
return strlen(string);
diff --git a/drivers/staging/csr/csr_util.h b/drivers/staging/csr/csr_util.h
index c7aa3a6ecee4..ffd35df8b4dc 100644
--- a/drivers/staging/csr/csr_util.h
+++ b/drivers/staging/csr/csr_util.h
@@ -28,14 +28,12 @@ void CsrUInt16ToHex(u16 number, char *str);
/*------------------------------------------------------------------*/
#ifdef CSR_USE_STDC_LIB
#define CsrMemCpy memcpy
-#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 *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);
char *CsrStrChr(const char *string, char c);