mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-25 02:09:42 +00:00
staging: csr: remove CsrStrLen()
It's just a wrapper around strlen(), so call that instead. Also add a few #include <linux/string.h> to fix up the build with this change. 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>
This commit is contained in:
parent
e4bcecd947
commit
4bcb20f834
7 changed files with 19 additions and 29 deletions
|
@ -50,14 +50,14 @@ EXPORT_SYMBOL_GPL(CsrMemCpyDes);
|
|||
void CsrCharStringDes(char **value, u8 *buffer, size_t *offset)
|
||||
{
|
||||
*value = kstrdup((char *) &buffer[*offset], GFP_KERNEL);
|
||||
*offset += CsrStrLen(*value) + 1;
|
||||
*offset += strlen(*value) + 1;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(CsrCharStringDes);
|
||||
|
||||
void CsrUtf8StringDes(u8 **value, u8 *buffer, size_t *offset)
|
||||
{
|
||||
*value = (u8 *)kstrdup((char *) &buffer[*offset], GFP_KERNEL);
|
||||
*offset += CsrStrLen((char *) *value) + 1;
|
||||
*offset += strlen((char *) *value) + 1;
|
||||
}
|
||||
|
||||
void CsrUtf16StringDes(u16 **value, u8 *buffer, size_t *offset)
|
||||
|
@ -124,7 +124,7 @@ void CsrCharStringSer(u8 *buffer, size_t *offset, const char *value)
|
|||
if (value)
|
||||
{
|
||||
strcpy(((char *) &buffer[*offset]), value);
|
||||
*offset += CsrStrLen(value) + 1;
|
||||
*offset += strlen(value) + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -176,7 +176,7 @@ u32 CsrCharStringSerLen(const char *str)
|
|||
{
|
||||
if (str)
|
||||
{
|
||||
return (u32) (CsrStrLen(str) + sizeof(*str));
|
||||
return (u32)(strlen(str) + sizeof(*str));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -188,7 +188,7 @@ u32 CsrUtf8StringSerLen(const u8 *str)
|
|||
{
|
||||
if (str)
|
||||
{
|
||||
return (u32) (CsrStrLen((char *) str) + sizeof(*str));
|
||||
return (u32)(strlen((char *) str) + sizeof(*str));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -390,7 +390,7 @@ void *CsrEventCsrUint16CsrUint32Des(u8 *buffer, size_t length)
|
|||
size_t CsrEventCsrUint16CsrCharStringSizeof(void *msg)
|
||||
{
|
||||
CsrEventCsrUint16CsrCharString *primitive = (CsrEventCsrUint16CsrCharString *) msg;
|
||||
return 4 + CsrStrLen(primitive->value2) + 1;
|
||||
return 4 + strlen(primitive->value2) + 1;
|
||||
}
|
||||
|
||||
u8 *CsrEventCsrUint16CsrCharStringSer(u8 *ptr, size_t *len, void *msg)
|
||||
|
@ -445,7 +445,7 @@ void *CsrEventCsrUint32CsrUint16Des(u8 *buffer, size_t length)
|
|||
size_t CsrEventCsrUint32CsrCharStringSizeof(void *msg)
|
||||
{
|
||||
CsrEventCsrUint32CsrCharString *primitive = (CsrEventCsrUint32CsrCharString *) msg;
|
||||
return 6 + CsrStrLen(primitive->value2) + 1;
|
||||
return 6 + strlen(primitive->value2) + 1;
|
||||
}
|
||||
|
||||
u8 *CsrEventCsrUint32CsrCharStringSer(u8 *ptr, size_t *len, void *msg)
|
||||
|
|
|
@ -573,7 +573,7 @@ u16 *CsrUtf82Utf16String(const u8 *utf8String)
|
|||
{
|
||||
return NULL;
|
||||
}
|
||||
sourceLength = CsrStrLen((char *) utf8String);
|
||||
sourceLength = strlen((char *)utf8String);
|
||||
|
||||
for (i = 0; i < sourceLength; i++)
|
||||
{
|
||||
|
@ -1020,7 +1020,7 @@ u32 CsrUtf8StringLengthInBytes(const u8 *string)
|
|||
size_t length = 0;
|
||||
if (string)
|
||||
{
|
||||
length = CsrStrLen((const char *) string);
|
||||
length = strlen((const char *)string);
|
||||
}
|
||||
return (u32) length;
|
||||
}
|
||||
|
|
|
@ -44,14 +44,6 @@ void *CsrMemCpy(void *dest, const void *src, size_t count)
|
|||
EXPORT_SYMBOL_GPL(CsrMemCpy);
|
||||
#endif
|
||||
|
||||
#ifndef CSR_USE_STDC_LIB
|
||||
size_t CsrStrLen(const char *string)
|
||||
{
|
||||
return strlen(string);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(CsrStrLen);
|
||||
#endif
|
||||
|
||||
MODULE_DESCRIPTION("CSR Operating System Kernel Abstraction");
|
||||
MODULE_AUTHOR("Cambridge Silicon Radio Ltd.");
|
||||
MODULE_LICENSE("GPL and additional rights");
|
||||
|
|
|
@ -28,10 +28,8 @@ void CsrUInt16ToHex(u16 number, char *str);
|
|||
/*------------------------------------------------------------------*/
|
||||
#ifdef CSR_USE_STDC_LIB
|
||||
#define CsrMemCpy memcpy
|
||||
#define CsrStrLen strlen
|
||||
#else /* !CSR_USE_STDC_LIB */
|
||||
void *CsrMemCpy(void *dest, const void *src, size_t count);
|
||||
size_t CsrStrLen(const char *string);
|
||||
#endif /* !CSR_USE_STDC_LIB */
|
||||
|
||||
#define CsrOffsetOf(st, m) ((size_t) & ((st *) 0)->m)
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/* Note: this is an auto-generated file. */
|
||||
|
||||
#include <linux/string.h>
|
||||
#include "csr_pmem.h"
|
||||
#include "csr_msgconv.h"
|
||||
#include "csr_unicode.h"
|
||||
|
@ -324,7 +324,7 @@ size_t CsrWifiNmeApStartReqSizeof(void *msg)
|
|||
break;
|
||||
case CSR_WIFI_NME_AP_CREDENTIAL_TYPE_PASSPHRASE:
|
||||
bufferSize += 2; /* u16 primitive->apCredentials.nmeAuthType.authTypePersonal.authPers_credentials.passphrase.encryptionMode */
|
||||
bufferSize += (primitive->apCredentials.nmeAuthType.authTypePersonal.authPers_credentials.passphrase.passphrase?CsrStrLen(primitive->apCredentials.nmeAuthType.authTypePersonal.authPers_credentials.passphrase.passphrase) : 0) + 1; /* char* primitive->apCredentials.nmeAuthType.authTypePersonal.authPers_credentials.passphrase.passphrase (0 byte len + 1 for NULL Term) */
|
||||
bufferSize += (primitive->apCredentials.nmeAuthType.authTypePersonal.authPers_credentials.passphrase.passphrase ? strlen(primitive->apCredentials.nmeAuthType.authTypePersonal.authPers_credentials.passphrase.passphrase) : 0) + 1; /* char* primitive->apCredentials.nmeAuthType.authTypePersonal.authPers_credentials.passphrase.passphrase (0 byte len + 1 for NULL Term) */
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/* Note: this is an auto-generated file. */
|
||||
|
||||
#include <linux/string.h>
|
||||
#include "csr_pmem.h"
|
||||
#include "csr_msgconv.h"
|
||||
#include "csr_unicode.h"
|
||||
|
@ -732,7 +732,7 @@ size_t CsrWifiRouterCtrlWifiOnResSizeof(void *msg)
|
|||
}
|
||||
}
|
||||
bufferSize += 4; /* u32 primitive->smeVersions.firmwarePatch */
|
||||
bufferSize += (primitive->smeVersions.smeBuild?CsrStrLen(primitive->smeVersions.smeBuild) : 0) + 1; /* char* primitive->smeVersions.smeBuild (0 byte len + 1 for NULL Term) */
|
||||
bufferSize += (primitive->smeVersions.smeBuild ? strlen(primitive->smeVersions.smeBuild) : 0) + 1; /* char* primitive->smeVersions.smeBuild (0 byte len + 1 for NULL Term) */
|
||||
bufferSize += 4; /* u32 primitive->smeVersions.smeHip */
|
||||
bufferSize += 1; /* u8 primitive->scheduledInterrupt */
|
||||
return bufferSize;
|
||||
|
@ -1793,7 +1793,7 @@ size_t CsrWifiRouterCtrlWifiOnIndSizeof(void *msg)
|
|||
bufferSize += 4; /* u32 primitive->versions.chipVersion */
|
||||
bufferSize += 4; /* u32 primitive->versions.firmwareBuild */
|
||||
bufferSize += 4; /* u32 primitive->versions.firmwareHip */
|
||||
bufferSize += (primitive->versions.routerBuild?CsrStrLen(primitive->versions.routerBuild) : 0) + 1; /* char* primitive->versions.routerBuild (0 byte len + 1 for NULL Term) */
|
||||
bufferSize += (primitive->versions.routerBuild ? strlen(primitive->versions.routerBuild) : 0) + 1; /* char* primitive->versions.routerBuild (0 byte len + 1 for NULL Term) */
|
||||
bufferSize += 4; /* u32 primitive->versions.routerHip */
|
||||
return bufferSize;
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/* Note: this is an auto-generated file. */
|
||||
|
||||
#include <linux/string.h>
|
||||
#include "csr_pmem.h"
|
||||
#include "csr_msgconv.h"
|
||||
#include "csr_unicode.h"
|
||||
|
@ -5421,9 +5421,9 @@ size_t CsrWifiSmeVersionsGetCfmSizeof(void *msg)
|
|||
bufferSize += 4; /* u32 primitive->versions.firmwareBuild */
|
||||
bufferSize += 4; /* u32 primitive->versions.firmwarePatch */
|
||||
bufferSize += 4; /* u32 primitive->versions.firmwareHip */
|
||||
bufferSize += (primitive->versions.routerBuild?CsrStrLen(primitive->versions.routerBuild) : 0) + 1; /* char* primitive->versions.routerBuild (0 byte len + 1 for NULL Term) */
|
||||
bufferSize += (primitive->versions.routerBuild ? strlen(primitive->versions.routerBuild) : 0) + 1; /* char* primitive->versions.routerBuild (0 byte len + 1 for NULL Term) */
|
||||
bufferSize += 4; /* u32 primitive->versions.routerHip */
|
||||
bufferSize += (primitive->versions.smeBuild?CsrStrLen(primitive->versions.smeBuild) : 0) + 1; /* char* primitive->versions.smeBuild (0 byte len + 1 for NULL Term) */
|
||||
bufferSize += (primitive->versions.smeBuild ? strlen(primitive->versions.smeBuild) : 0) + 1; /* char* primitive->versions.smeBuild (0 byte len + 1 for NULL Term) */
|
||||
bufferSize += 4; /* u32 primitive->versions.smeHip */
|
||||
return bufferSize;
|
||||
}
|
||||
|
@ -5676,7 +5676,7 @@ size_t CsrWifiSmeErrorIndSizeof(void *msg)
|
|||
size_t bufferSize = 2;
|
||||
|
||||
/* Calculate the Size of the Serialised Data. Could be more efficient (Try 3) */
|
||||
bufferSize += (primitive->errorMessage?CsrStrLen(primitive->errorMessage) : 0) + 1; /* char* primitive->errorMessage (0 byte len + 1 for NULL Term) */
|
||||
bufferSize += (primitive->errorMessage ? strlen(primitive->errorMessage) : 0) + 1; /* char* primitive->errorMessage (0 byte len + 1 for NULL Term) */
|
||||
return bufferSize;
|
||||
}
|
||||
|
||||
|
@ -5718,7 +5718,7 @@ size_t CsrWifiSmeInfoIndSizeof(void *msg)
|
|||
size_t bufferSize = 2;
|
||||
|
||||
/* Calculate the Size of the Serialised Data. Could be more efficient (Try 3) */
|
||||
bufferSize += (primitive->infoMessage?CsrStrLen(primitive->infoMessage) : 0) + 1; /* char* primitive->infoMessage (0 byte len + 1 for NULL Term) */
|
||||
bufferSize += (primitive->infoMessage ? strlen(primitive->infoMessage) : 0) + 1; /* char* primitive->infoMessage (0 byte len + 1 for NULL Term) */
|
||||
return bufferSize;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue